Skip to Content

Not able to receive data from a bapi with changing tables

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 08:21 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 12:19 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 19, 2006 at 03:29 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.