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

Call ME5A (parameter passing problem)

Former Member
0 Likes
1,865

hI,

I want to call 'ME5A' from abap program by giving release date,material number as  a parameter but report executes without taking the effect of release date parameters.

Material and p_lstub parameters(report type) are working and report is showing only those material which I am passing through the following code but date parameters are not working.

SUBMIT RM06BA00

           "

            WITH BA_MATNR-LOW = WA_FORECAST_OUT-IDNRK

            WITH S_FRGDT-LOW  = WA_FORECAST_OUT-FROMDATE--------> these parameter is not working

            WITH S_FRGDT-HIGH = WA_FORECAST_OUT-TODATE--------------> these parameter is not working

            WITH P_LSTUB = 'ALV' AND RETURN.

I have tried to give constant parameter but it did not work.

Please let me know How to resolve this issue.

Regards

M.Waqas Khan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,551

Hi Muhammad,

Try this.

SUBMIT RM06BA00

           "

            WITH BA_MATNR-LOW = WA_FORECAST_OUT-IDNRK

            WITH S_FRGDT-SIGN = 'I'

             WITH S_FRGDT-OPTION = 'BT'

            WITH S_FRGDT-LOW  = WA_FORECAST_OUT-FROMDATE

            WITH S_FRGDT-HIGH = WA_FORECAST_OUT-TODATE

            WITH P_LSTUB = 'ALV' AND RETURN.

I hope this will help you.

Regards,

Ashish Kumar

7 REPLIES 7
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
1,551

Hello Waqas Khan.

Refer this sample code and analyse your case.

DATA: BEGIN OF RS OCCURS 0.

         INCLUDE STRUCTURE RSPARAMS.

DATA: END OF RS.


RS-SELNAME = 'P_LSTUB'.

RS-KIND = 'P'.                          "Parameter

RS-SIGN = 'I'.

RS-OPTION = 'EQ'.

RS-LOW = 'ALV'.

APPEND RS.

RS-SELNAME = 'BA_MATNR-LOW'.

RS-KIND = 'S'.                          "Select-options

RS-SIGN = 'I'.

RS-OPTION = 'EQ'.

RS-LOW = 'MATERIAL'.

APPEND RS.

RS-SELNAME = 'S_FRGDT'.

RS-KIND = 'S'.                          "Select-options

RS-SIGN = 'I'.

RS-OPTION = 'BT'.

RS-LOW = '20120210'.

RS-HIGH = '20120211'.

APPEND RS.

SUBMIT RM06BA00 WITH SELECTION-TABLE RS AND RETURN.

Regards.

Read only

0 Likes
1,551

Thanks.

Is this code  will be same for ME55 (RM06BF00)

Read only

0 Likes
1,551

To get the field names of a standard tcode,

Press F1 on that field->Click Technical information->Screen field.

Then pass appropriate values(P-Parameter/S-Select options etc) to variable of structure RSPARAMS.

Through this, you can call standard tcodes with the data without any hit and try approach .

Read only

SujeetMishra
Active Contributor
0 Likes
1,551

Hi,

SUBMIT rm06ba00 TO SAP-SPOOL WITHOUT SPOOL.

Regards,

Sujeet

Read only

Former Member
0 Likes
1,552

Hi Muhammad,

Try this.

SUBMIT RM06BA00

           "

            WITH BA_MATNR-LOW = WA_FORECAST_OUT-IDNRK

            WITH S_FRGDT-SIGN = 'I'

             WITH S_FRGDT-OPTION = 'BT'

            WITH S_FRGDT-LOW  = WA_FORECAST_OUT-FROMDATE

            WITH S_FRGDT-HIGH = WA_FORECAST_OUT-TODATE

            WITH P_LSTUB = 'ALV' AND RETURN.

I hope this will help you.

Regards,

Ashish Kumar

Read only

0 Likes
1,551

I did it with the following code but I am not clear with the logic,

I did it with hit and try, Can anyone explain the me what is the actual mechanism

FOR ME55


SUBMIT RM06BA00

            WITH P_LSTUB = 'ALV'

            WITH BA_MATNR-LOW  = WA_FORECAST_OUT-IDNRK

            WITH BA_FRGDT-LOW  BETWEEN  WA_FORECAST_OUT-F_DATE2 AND WA_FORECAST_OUT-END_DATE1

            "WITH BA_FRGDT-HIGH = WA_FORECAST_OUT-END_DATE1

            AND RETURN .

FOR ME5A

SUBMIT RM06BF00

WITH S_MATNR  = WA_FORECAST_OUT-IDNRK

WITH S_FRGDT   BETWEEN WA_FORECAST_OUT-FROMDATE AND WA_FORECAST_OUT-TODATE

WITH P_FRGAB = '01'

WITH P_LSTUB = 'ALV'   AND RETURN .

Read only

0 Likes
1,551

After the above solution I am facing one issue.

PR showing with the status : Release only via indiv.release.

Although when I executed the report ME55 ( PR Release) from tcode then it is showing release option .

Why this happens in calling .