07-12-2009 9:37 AM
I have called transactions QP02 and QP03 by passing the data as shown in the below code.
SET PARAMETER ID: 'PLN' FIELD gwa_plancreated-plnnr,
'MAT' FIELD gwa_plancreated-matnr,
'WRK' FIELD gwa_plancreated-werks,
'PAL' FIELD gwa_plancreated-plnal.
CALL TRANSACTION 'QP03' AND SKIP FIRST SCREEN.
SET PARAMETER ID: 'PLN' FIELD gwa_plancreated-plnnr,
'MAT' FIELD gwa_plancreated-matnr,
'WRK' FIELD gwa_plancreated-werks,
'PAL' FIELD gwa_plancreated-plnal.
CALL TRANSACTION 'QP02' AND SKIP FIRST SCREEN.
I could do the above thing because the initial screens of those transactions have some fileds which need to be filled with data.
I should do the same for CG02 transaction But the problem is that i cannot pass the values because we need to first press a push button to navigate to the fields. Please see the transaction CG02 once and provide me with a solution.
07-12-2009 10:34 AM
Hi, Vishnu
You better do the following way here is the Sample Code.
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_it_bdcdata LIKE LINE OF it_bdcdata.
DATA opt TYPE ctu_params.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-program = 'SAPLCPDI'.
wa_it_bdcdata-dynpro = '8010'.
wa_it_bdcdata-dynbegin = 'X'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_CURSOR'.
wa_it_bdcdata-fval = 'RC27M-MATNR'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'RC27M-MATNR'.
wa_it_bdcdata-fval = '00009700100900'. " Here Give Matnr
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_CURSOR'.
wa_it_bdcdata-fval = 'RC27M-WERKS'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'RC27M-WERKS'.
wa_it_bdcdata-fval = '3000'. " Here Enter Werks
APPEND wa_it_bdcdata TO it_bdcdata.
opt-dismode = 'E'.
CALL TRANSACTION 'QP02' USING it_bdcdata OPTIONS FROM opt.
Please Reply if any Issue,
Best Regards,
Faisal
07-12-2009 10:37 AM
Hi Faisal,
thanks alot for the answer. But i have no issues with QP02 or QP03 transactions. I have issue with CG02 transaction. Please help me solving this.
07-12-2009 11:04 AM
could you please reformat your initial question, because it appears too wide in the navigator.
One solution to your issue is to call CG02 by "call transaction" in E mode (display screen only if error), so that to simulate button (and you may fill fields) and E is to remain on the last dynpro (though E is usually used for tests, this behavior is a welcome side effect ).
07-12-2009 11:10 AM
07-12-2009 2:04 PM
Look at ABAP documentation : CALL TRANSACTION ... USING ... MODE 'E'. You may use SHDB and record your transaction to see how USING internal table is to be formatted.