Skip to Content
-4

ASSIGN COMPONENT and INCLUDES

Hello,

I have a function module with a structure like this....

DATA: BEGIN OF ls_CORCTS_PRO_ENH.
DATA: INCLUDE TYPE /SAPSLL/CORCTS.
DATA: CCNGN TYPE /SAPSLL/CCNGN.
DATA: END OF ls_CORCTS_PRO_ENH.

The data is filled and passed to another function module with a type ANY....

USING uv_ROLLNAME TYPE ROLLNAME
us_PROVISION TYPE ANY

When this statement is executed, nothing is in <field>...

ASSIGN COMPONENT us_DFIES-FIELDNAME OF STRUCTURE us_PROVISION TO <field>.

I am wandering if the INCLUDE is the issue. Because, when I debug, the INCLUDE is shown as a direct component of the structure, not the fields of the INCLUDE....

STRUCTURE

+INCLUDE

CCNGN

Is this the issue?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 25 at 06:59 AM

    No.

    You could easily answer this question yourself by reading the documentation for INCLUDE TYPE or writing a little test as

    CLASS demo DEFINITION.
      PUBLIC SECTION.
      CLASS-METHODS main IMPORTING p TYPE any.
    ENDCLASS.
    CLASS demo IMPLEMENTATION.
      METHOD main.
      ASSIGN COMPONENT 'CARRID' OF STRUCTURE p TO FIELD-SYMBOL(<fs>).
      IF sy-subrc = 0.
      cl_demo_output=>display( <fs> ).
      ENDIF.
      ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
      DATA BEGIN OF struct.
      INCLUDE TYPE scarr.
      DATA END OF struct.
      struct = VALUE #( carrid = 'XX' ).
      demo=>main( struct ).		
    

    I'd rather say, that your /SAPSLL/CORCTS has a substructure.

    Add comment
    10|10000 characters needed characters exceeded