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 Transaction with document and item number

aboooood
Participant
0 Kudos
678

Hello Experts, i would like to call a Tcode Z0AVW and there u can but the documentno and itemno

it works but it only jumps into documentno wihtout the item so i have to manuelly looking for the itme number.

this is my code:

SET PARAMETER ID 'AUN' FIELD object-key-salesdocumentno.  <br>SET PARAMETER ID 'APO' FIELD object-key-itemno.<br>
CALL TRANSACTION 'Z0AVW' WITH AUTHORITY-CHECK AND SKIP FIRST SCREEN.
1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
574

As it's a customer (namespace) transaction, you have to locally analyze how the associated program handle parameter-ids (defined in initial dynpro or read in some report event such as INITIALIZATION)

13 REPLIES 13

Sandra_Rossi
Active Contributor
0 Kudos
574

Impossible to help as Z0AVW is a Z object (custom).

How did you define the screen fields? What parameter IDs do they have? Are you sure you didn't clear the value?

aboooood
Participant
0 Kudos
574

the parameter ID in the Tcode Z0AVW are AUN for the documnetno and APO for the itemno

and when i debug the programm it shows me that he got the right documnetno and the itemno as well

and no there is no clear to the value

raymond_giuseppi
Active Contributor
575

As it's a customer (namespace) transaction, you have to locally analyze how the associated program handle parameter-ids (defined in initial dynpro or read in some report event such as INITIALIZATION)

0 Kudos
574

i tried with patch input and it worked but not quite right here is my code :

DATA: lt_bdcdata TYPE wlf_tt_bdcdata,
      ls_bdcdata TYPE bdcdata.

ls_bdcdata-program = 'ZAVW_ENERGIE_MEDIEN_GRID'.
ls_bdcdata-dynpro = '1000'.
ls_bdcdata-dynbegin = 'X'.
APPEND ls_bdcdata TO lt_bdcdata.

CLEAR ls_bdcdata.

ls_bdcdata-fnam = 'BDC_CURSOR'.
ls_bdcdata-fval = 'S_POSNR-LOW'.
APPEND ls_bdcdata TO lt_bdcdata.

CLEAR ls_bdcdata.

ls_bdcdata-fnam = 'BDC_OKCODE'.
ls_bdcdata-fval = '=FC02'.
APPEND ls_bdcdata TO lt_bdcdata.

CLEAR ls_bdcdata.

ls_bdcdata-fnam = 'P_VBELN'.
ls_bdcdata-fval = object-key-salesdocumentno.
APPEND ls_bdcdata TO lt_bdcdata.

CLEAR ls_bdcdata.

ls_bdcdata-fnam = 'S_POSNR_LOW'.
ls_bdcdata-fval = object-key-itemno.
APPEND ls_bdcdata TO lt_bdcdata.

CLEAR ls_bdcdata.
CALL TRANSACTION 'Z0AVW' WITH AUTHORITY-CHECK USING lt_bdcdata


0 Kudos
574
  • It would be much easier to SUBMIT the report behind the transaction.
  • If you actually require to use a CALL TRANSACTION, look at this Wiki : Fill SELECT-OPTIONS in BDCDATA /or/ execute again SHDB but in the recording use the icon right of the select-option and input the value in the next screen

0 Kudos
574

im sorry i have never tried this before. how tu submit this?

574

In your code use the SUBMIT statement pattern with the program name, you will get list of available parameters/select-options.

sample

CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
  EXPORTING
    tcode  = 'Z0AVW'
  EXCEPTIONS
    ok     = 0
    OTHERS = 4.
iF SY-subrc eq 0.
  SUBMIT ZAVW_ENERGIE_MEDIEN_GRID
    USING SELECTION-SCREEN 1000
    WITH P_VBELN EQ object-key-salesdocumentno
    WITH S_POSNR EQ object-key-itemno
    AND RETURN.
ELSE.
  MESSAGE e172(00) with 'Z0AVW'. 
ENDIF.

0 Kudos
574

thank u so much sir its working now !!!

last question, ist it possible to get in the tcode but in the changing mode?

574

nvm, i just read the wiki u sent my error was i called the Tcode without MODE or UPDATE now its shoould look like this:

CALL TRANSACTION 'Z0AVW' WITH AUTHORITY-CHECK USING lt_bdcdata MODE 'E' UPDATE 'A'.

574

It is ridiculous to call a Z transaction on a Z program using call transaction and BDCDATA. It is even worse when the Z program is a report program! Do what Raymond suggests and use SUBMIT.

0 Kudos
574

matthew.billingham i know that and told my boss about that but he wasnt happy with the submit cuz the programm starting in the show mode not changing so he told me to use BDCDATA

0 Kudos
574

Then add a MEMORY ID pid to the order parameter and item select-option in the called program, so you can use CALL TRANSACTION. (The only case that would actually justify this, apart from the ire/lubia of a chief/customer (*), would be the management of certain authorizations on the transaction, by SU24...)

(*) The customer/Chief is always right-even when they are wrong?

0 Kudos
574

Change the Z program so it can be called via submit in change mode.

The point is it's a Z program. It can be changed by you!