Application Development and Automation 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: 
Read only

Issue when using SWC_SET_TABLE inside loop.....

Former Member
0 Likes
367

Hello Gurus,

I am working on business object ABAP. Now I am using SWC_GET_TABLE to pass work areas data

to business object method from ABAP as follows:

The issue is at SWC_SET_TABLE because, during the second pass in loop the statement SWC_SET_TABLE LT_CONTAINER_s 'CHGTAB' GT_ALV does not set the GT_ALV to new values

in the loop.

DATA: L_OBJECT_s   TYPE SWC_OBJECT,
            L_OBJTYPE_s  LIKE SWOTOBJID-OBJTYPE,
            L_KEY_s      LIKE SWOTOBJID-OBJKEY,
            L_RETURN_s   LIKE SWOTRETURN,
            L_VERB_s     LIKE SWOTINVOKE-VERB.       

LOOP AT GT_ALV.        
        SWC_CONTAINER LT_CONTAINER_s.
        L_OBJTYPE_s = GT_ALV-SAPOBJECT.
        L_VERB_s = 'ChangeData'.
        L_KEY_s = GT_ALV-OBJECT_ID.

        SWC_CREATE_OBJECT L_OBJECT_s L_OBJTYPE_s L_KEY_s.
        SWC_CREATE_CONTAINER LT_CONTAINER_s.

        SWC_SET_TABLE LT_CONTAINER_s 'CHGTAB' GT_ALV.


        CALL FUNCTION 'SWO_INVOKE'
          EXPORTING
            OBJECT    = L_OBJECT_s-HANDLE
            VERB      = L_VERB_s
            SYNCHRON  = 'X'
          IMPORTING
            RETURN    = L_RETURN_s
          TABLES
            CONTAINER = LT_CONTAINER_s
          EXCEPTIONS
            OTHERS    = 1.

      ENDLOOP.

Regards,

Rajesh.

Edited by: Rajesh Thomas on Feb 6, 2009 6:33 PM

1 REPLY 1
Read only

Former Member
0 Likes
338

Any help will be appreciated...

Edited by: Rajesh Thomas on Feb 6, 2009 8:38 PM