on 2006 Oct 19 8:15 AM
hi,
i'm using a bapi that uses two changing tables. in the first table i have to input data before the call that gets updated and on the second table i just want to receive results.
but in the scond table i have to give an initial line, too, otherwise the bapi complains, that mandatory input fields are not filled.
the problem is, that i'm not able to get the values from the second table. even if i store not an empty line but some values in it, i receive exactly the same values in the output node of the table i stored before the call. if we add a line <b>manually</b> in the table <b>inside the bapi</b>, i receive this line additionally, too. but not the lines, that are evaluated during the bapi call.
is there a special thing to consider about changing tables (not using import/export tables)?
kr, achim
Request clarification before answering.
Hi Achim,
Use tables not from input parameters but from output because they are becoming "output". Here is cite from Chris Whealy book: "...duplicate parameter names will be found on both input and output sides of interface. In this situation, the ABAP dictionary strustures used in these parameters types will appear both as children of the _Input and _Output clesses".
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Achim,
in Bapi's you can't use CHANGING.
You can only use IMPORT / EXPORT.
make sure you check 'pass by value' for all paramaters as well.
Regards,
Joris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am surprised that you have an RFC Function Module which allows changing parameters.
No changing parameters are allowed in RFC R/3 Function Modules.
BAPI's are RFC enabled R/3 function modules.
Regards,
Subramanian V.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Subramanian,
see below the code we're using for the RFM.
on the ct_containers table i'm passing a line, and its getting updated after the call.
on the ct_errors table i just want to receive the errors and i only receive the line, we add manually there ('Serious error with validation code').
kr, achim
FUNCTION zbapi_ra_validations .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IS_RA_SCREEN) TYPE ZBAPI_S_RA_SCREEN
*" CHANGING
*" VALUE(CT_ERRORS) TYPE ZRA_T_ERRORS
*" VALUE(CT_CONTAINERS) TYPE ZRA_T_CONT_IP
*"----------------------------------------------------------------------
DATA:
lo_badi_handle TYPE REF TO zra_validation_rule,
ls_error TYPE zra_s_error.
GET BADI lo_badi_handle.
TRY.
CALL BADI lo_badi_handle->validate_rules
EXPORTING
is_screen_flds = is_ra_screen
CHANGING
ct_containers = ct_containers
ct_errors = ct_errors.
CATCH zcx_ra.
ls_error-message = 'Serious error with validation code'.
APPEND ls_error TO ct_errors.
ENDTRY.
ENDFUNCTION.
if i call this rfm in SE37 the ct_errors table is populated with all errors and the manually created line.
Message was edited by: Achim Hauck
User | Count |
---|---|
58 | |
10 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.