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: 

Call Transcation not working for certain T-Codes

Former Member
0 Kudos

Here is my code. My issue is getting the CALL TRANSACTION to work for VA05 and VA35. The code below works fine when calling MM03, so I thought using the exact same logic would work for the other two, but no luck. The matnr is not populated for the VA05 or VA35 screen, thus the transaction is returning all records. I tried removing "SKIP FIRST SCREEN", but that did not help. I've verified in debugger that the ID is being set. I am using ECC 6.0. Any ideas?

READ TABLE output_table INTO wa_output INDEX p_selfield-tabindex.

CHECK sy-subrc = 0.

IF wa_output-matnr <> space.

CASE p_ucomm.

WHEN '&IC1'.

CASE p_selfield-sel_tab_field.

WHEN 'OUTPUT_TABLE-MATNR'.

SET PARAMETER ID 'MAT' FIELD wa_output-matnr.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

WHEN 'OUTPUT_TABLE-GETOR'.

SET PARAMETER ID 'MAT' FIELD wa_output-matnr.

CALL TRANSACTION 'VA05' AND SKIP FIRST SCREEN.

WHEN 'OUTPUT_TABLE-GETSA'.

SET PARAMETER ID 'MAT' FIELD wa_output-matnr.

CALL TRANSACTION 'VA35' AND SKIP FIRST SCREEN.

ENDCASE.

ENDCASE.

ENDIF.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Provide value to all mandatory fields of VA35 and VA05 transaction

Like sold-to-party, material, Purchase Order No and Document dates and Selection Criteria.

I can only see you are passing Material number and nothing else.

It will work fine. Pass the values.

Thanks,

Kartavya

5 REPLIES 5

former_member585060
Active Contributor
0 Kudos

Hi,

IF wa_output-matnr space.<< space.

i think, it goes into if condition when matnr is space.

Make it as

IF wa_output-matnr IS NOT INITIAL.

former_member188685
Active Contributor
0 Kudos

For these Transactions you can use VA05N and VA35N .

Instead of Call TRANSACTION on these you can also try with SUBMIT with paramters/select options addition and RERTURN option.

This will work.

Former Member
0 Kudos

Hi,

Provide value to all mandatory fields of VA35 and VA05 transaction

Like sold-to-party, material, Purchase Order No and Document dates and Selection Criteria.

I can only see you are passing Material number and nothing else.

It will work fine. Pass the values.

Thanks,

Kartavya

0 Kudos

Please make sure you give all the required field is passed before call transaction.

this is done by set parameter. In case of material the parameter id is MAT

To find the parameter id of other fields press F1 with cursor on the field you can find them in the technical settings.

Former Member
0 Kudos

I removed the "If kunnr <> space" logic and it made no difference, so that is not the problem.

I don't believe that VA05 or VA35 has any required parameters, further the SoldTo field for those two transactions does not have a Parameter ID value, so I don't think I can pass a value to it. Maybe I'm wrong about that.

Lastly, I switched to using VA05N and VA35N. I'm have a bit better luck. For example, I can successfully pass the kunnr and matnr to those transactions now, but when trying to pass the vkorg or vtweg, it does not work (populate as blank/initial, even though debugger shows values being assigned to them). I used the F1 'trick' and verified that I'm using the correct Parameter ID for each (VKO, VTW, SPA).

Very strange. Thanks for all the help thus far. It is appreciated!