Application Development and Automation 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: 
Read only

Executing report via a FM???

Former Member
0 Likes
568

Hi

I am trying to execute a report with the selection-screen via a FM,by passing the values to report screen through the import para of FM,which i m initilizating through the initilization even in Report,but after that report is not executing itself,i hv to execute it each time,than its reutrning the EXP param.

Please tel me how to make it execute,or how shd i initilized the screen values...other than initilization event,if its creating any prob?

FUNCTION zmm_stock_value_matnr.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(I_MATNR) TYPE MARA-MATNR

*" REFERENCE(I_WERKS) TYPE MARC-WERKS

*" REFERENCE(I_DATE) TYPE CDHDR-UDATE

*" EXPORTING

*" REFERENCE(O_STOCK) TYPE MSEG-MENGE

*"----


DATA : zmatnr(18),

zwerks(4),

zdate(8),

pstock(13).

SET PARAMETER ID 'ZMATNR' FIELD i_matnr.

SET PARAMETER ID 'ZWERKS' FIELD i_werks.

SET PARAMETER ID 'ZDATE' FIELD i_date.

submit zhzlmm_closing_stock via selection-screen and return.

GET PARAMETER ID 'ZSTOCK' FIELD pstock.

MOVE pstock TO o_stock.

ENDFUNCTION.

&----


*& INITIALIZATION

&----


INITIALIZATION.

GET PARAMETER ID 'ZDATE' FIELD so_budat-low.

APPEND so_budat.

GET PARAMETER ID 'ZMATNR' FIELD so_matnr-low.

APPEND so_matnr.

GET PARAMETER ID 'ZWERKS' FIELD p_werks.

regds

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
541

Hi,

Replace the submit statement as follows:

Submit <Report_program_name> and return.

If you use VIA SELECTION-SCREEN addition it will prompt you to go for the selection-screen of the report.

Regards,

Sankar.

4 REPLIES 4
Read only

rahulkavuri
Active Contributor
0 Likes
541
*submit zhzlmm_closing_stock via selection-screen and return.

submit zhzlmm_closing_stock and return.

Edit it like this

Read only

Former Member
0 Likes
542

Hi,

Replace the submit statement as follows:

Submit <Report_program_name> and return.

If you use VIA SELECTION-SCREEN addition it will prompt you to go for the selection-screen of the report.

Regards,

Sankar.

Read only

Former Member
0 Likes
541

Hi

In your FM, use the SUBMIT keyword along the report program name, so that the control is transferred to the report program.

Thanks

Vijay

Read only

Former Member
0 Likes
541

Hi,

FUNCTION zmm_stock_value_matnr.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(I_MATNR) TYPE MARA-MATNR

*" REFERENCE(I_WERKS) TYPE MARC-WERKS

*" REFERENCE(I_DATE) TYPE CDHDR-UDATE

*" EXPORTING

*" REFERENCE(O_STOCK) TYPE MSEG-MENGE

*"----


DATA : zmatnr(18),

zwerks(4),

zdate(8),

pstock(13).

SET PARAMETER ID 'ZMATNR' FIELD i_matnr.

SET PARAMETER ID 'ZWERKS' FIELD i_werks.

SET PARAMETER ID 'ZDATE' FIELD i_date.

submit zhzlmm_closing_stock and return.

GET PARAMETER ID 'ZSTOCK' FIELD pstock.

MOVE pstock TO o_stock.

ENDFUNCTION.

&----


*& INITIALIZATION

&----


INITIALIZATION.

GET PARAMETER ID 'ZDATE' FIELD so_budat-low.

APPEND so_budat.

GET PARAMETER ID 'ZMATNR' FIELD so_matnr-low.

APPEND so_matnr.

GET PARAMETER ID 'ZWERKS' FIELD p_werks.

Try the modified coding.

Regards,

Balakumar.G

Reward Points if helpful.