SAP ABAP HCM: Test and Upload Data to Decoupled Infotype

Below is sample program to test and upload a record in a decoupled infotype. Methods ‘test_infty9000_entry’ and ‘execute_infty9000_entry’ will have code specific to handle the decoupled infotype.

Continue reading SAP ABAP HCM: Test and Upload Data to Decoupled Infotype

ABAP: Release 740 new features

Below is the list of ABAP new commands and syntax available from version 740.

TYPES:
    BEGIN OF ty_tab,
      pernr TYPE persno,
    END OF ty_tab.

  DATA: tab TYPE STANDARD TABLE OF ty_tab.

  DATA wa_tab TYPE ty_tab.

  wa_tab-pernr = '00000001'.
  INSERT wa_tab INTO TABLE tab.

  wa_tab-pernr = '00000002'.
  INSERT wa_tab INTO TABLE tab.

  wa_tab-pernr = '00000003'.
  INSERT wa_tab INTO TABLE tab.

  LOOP AT tab ASSIGNING FIELD-SYMBOL(<tab>) FROM line_index( tab[ pernr = '00000002' ] ) .
    IF <tab> NE '00000002'.
      EXIT.
    ENDIF.
    WRITE: / sy-tabix, <tab>.
  ENDLOOP.

  "Retrieve WA where field meets condition
  DATA(lw_wa) = tab[ pernr = '00000003' ].

  "Retrieve field field meets condition
  DATA(lv_pernr) = tab[ pernr = '00000003' ]-pernr.

  "Update lines with '99999999' where field meets condition.
  tab[ pernr = '00000003' ]-pernr = '99999999'.

Additional links


http://scn.sap.com/docs/DOC-68458

http://zevolving.com/tag/abap-740/

https://scn.sap.com/community/abap/blog/2013/06/22/abap-news-for-release-740–new-internal-table-functions

Routine to get table line type dynamically

DATA: tabledescr         TYPE REF TO cl_abap_tabledescr,
      structuredescr     TYPE REF TO CL_ABAP_DATADESCR.
 
tabledescr ?= cl_abap_tabledescr=>describe_by_data( table_type ).
 
call method tabledescr->GET_TABLE_LINE_TYPE
     receiving P_DESCR_REF = structuredescr.

ASSERT structuredescr->absolute_name(6) = '\TYPE='.
structure_name = structuredescr->absolute_name+6(30).