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 transaction from query

Former Member
0 Likes
1,336

Hello

I have query which calling transaction MD04 which needs 2 parameters : Material & Plant.

I call the Transaction (from the query) by calling the hereunder ABAP Report Program.

Its doesn'twork...

Can u advise ?

Thanks.

Amnon.

REPORT ZMD04.

data : p_matnr type matnr,

p_werks type werks_d.

IMPORT MDKP-MATNR TO p_matnr FROM MEMORY ID 'P_MAT'.

SET PARAMETER ID 'MAT' FIELD P_MATNR.

SET PARAMETER ID 'WRK' FIELD P_WERKS.

call TRANSACTION 'MD04' AND SKIP FIRST SCREEN.

Hello

I have query which calling transaction MD04 which needs 2 parameters : Material & Plant.

I call the Transaction (from the query) by calling the hereunder ABAP Report Program.

Its doesn'twork...

Can u advise ?

Thanks.

Amnon.

REPORT ZMD04.

data : p_matnr type matnr,

p_werks type werks_d.

IMPORT MDKP-MATNR TO p_matnr FROM MEMORY ID 'P_MAT'.

SET PARAMETER ID 'MAT' FIELD P_MATNR.

SET PARAMETER ID 'WRK' FIELD P_WERKS.

call TRANSACTION 'MD04' AND SKIP FIRST SCREEN.

6 REPLIES 6
Read only

Abhijit74
Active Contributor
0 Likes
1,000

Hi,

What's your SAP version. I have tried with ECC6.0 it's working, i.e. it's calling the transaction. You can try with another way by submitting the program like SUBMIT SAPMM61R AND RETURN.

Thanks,

Abhijit

Read only

Former Member
0 Likes
1,000

Hello,

Thanks for your reply.

The transaction MD04 opened, but without the material and plant value from the line in the Abap-Query. Tthe parameters value in report are empty.

When the transaction MD04 opened, i get the error massage "fill in all required fields.

I use Ecc 6.

Amnon

Read only

Former Member
0 Likes
1,000

HI ,

Your code is proper & working.

Take any matnr & werks like below.

data : p_matnr type matnr VALUE '000000001000004065',

p_werks type werks_d VALUE '2001'.

IMPORT MDKP-MATNR TO p_matnr FROM MEMORY ID 'P_MAT'.

SET PARAMETER ID 'MAT' FIELD P_MATNR.

SET PARAMETER ID 'WRK' FIELD P_WERKS.

call TRANSACTION 'MD04' AND SKIP FIRST SCREEN.

Regard's

Shabbir

Read only

Former Member
0 Likes
1,000

Hi Amnon,

I tried this and working fine.

data : p_matnr type matnr VALUE '111',

p_werks type werks_d VALUE '123'.

SET PARAMETER ID 'MAT' FIELD P_MATNR.

SET PARAMETER ID 'WRK' FIELD P_WERKS.

call TRANSACTION 'MD04' AND SKIP FIRST SCREEN.

Please check your code. import may not working in your case. try in debug and check the value.

Regards,

Venkat

Read only

venkat_o
Active Contributor
0 Likes
1,000

Hi, <li> Problem may be with IMPORT MDKP-MATNR TO p_matnr FROM MEMORY ID 'P_MAT' statement. Check corresponding EXPORT statement where you are passing p_matnr value. <li>It does not skip first screen, if you pass empty material number. Thanks Venkat.O

Read only

Former Member
0 Likes
1,000

Hello Experts

I found the problem. I need to define the data with "PARAMETERS" command and not with "DATA".

Here is the final report :

REPORT ZMD04.

parameters : p_matnr type matnr,

parameters : p_werks type werks_d.

SET PARAMETER ID 'MAT' FIELD P_MATNR.

SET PARAMETER ID 'WRK' FIELD P_WERKS.

call TRANSACTION 'MD04' AND SKIP FIRST SCREEN.