Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

calling a report into a function module

Former Member
0 Kudos

hi,

i am giving the requirement,please help me in solving the issue.

Requirement.

i am having a functionmodule.we have to give the sales document as the input to the function module.

we have to call a report in which selection screen contains a parameter where we have to give the input as the sales document from the function module.

Please provide with me the required solution for this.

it is very urgent.....................

thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hI ...

Here is the Function Module for sales ducoment display based on the sales document number as input to the function module ..

just go to se37 in import give

R_VBELN TYPE VBAK-VBELN and in the source code as below lines ...

FUNCTION ZTEST_SALE.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(R_VBELN) TYPE  VBAK-VBELN
*"----------------------------------------------------------------------



SET PARAMETER ID 'BES' FIELD R_VBELN .

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN  .

ENDFUNCTION.

<b>the same quesry as report line </b>

report zasra.

parameter : R_VBELN like VBAK-VBELN.


SET PARAMETER ID 'BES' FIELD R_VBELN .

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN  .

reward points if it is usefull ...

Girish

2 REPLIES 2

Former Member
0 Kudos

Hi

If your fm has a table parameter in order to transfer the sales documents, in your fm:

RANGES: R_VBELN FOR VBAK-VBELN.

REFRESH R_VBELN.

LOOP AT T_SALES_DOC.
  R_VBELN(3) = 'IEQ'.
  R_VBELN-LOW = T_SALES_DOC-VBELN.
  APPEND R_VBELN.
ENDLOOP.
IF SY-SUBRC = 0.
  SUBMIT <REPORT> WITH SO_VBELN IN R_VBELN AND RETURN.
ENDIF.

Max

Former Member
0 Kudos

hI ...

Here is the Function Module for sales ducoment display based on the sales document number as input to the function module ..

just go to se37 in import give

R_VBELN TYPE VBAK-VBELN and in the source code as below lines ...

FUNCTION ZTEST_SALE.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(R_VBELN) TYPE  VBAK-VBELN
*"----------------------------------------------------------------------



SET PARAMETER ID 'BES' FIELD R_VBELN .

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN  .

ENDFUNCTION.

<b>the same quesry as report line </b>

report zasra.

parameter : R_VBELN like VBAK-VBELN.


SET PARAMETER ID 'BES' FIELD R_VBELN .

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN  .

reward points if it is usefull ...

Girish