Code: Alles auswählen.
data: it_pa0001 type table of pa0001,
wa_pa0001 type pa0001.
DATA: sdata_name like dcobjdef-name.
DATA: it_modify_0001 LIKE prelp OCCURS 0 WITH HEADER LINE.
DATA: it_objects LIKE hrobject OCCURS 0 WITH HEADER LINE.
DATA: it_out_hrobjsdata LIKE hrobjsdata OCCURS 0 WITH HEADER LINE.
DATA: it_error_message LIKE hrale_err OCCURS 0 WITH HEADER LINE.
*--- Infotyp nachträglich aus DB-lesen zwecks Manipulation ---*
SELECT * FROM pa0001
INTO TABLE it_pa0001
WHERE pernr EQ ?00004711? "zu Testzwecken eingeschränkt
AND begda LE '99991231'
AND endda GE '18000101'
ORDER BY PRIMARY KEY.
*--- Daten des Infotypen manipulieren ---*
LOOP AT it_pa0001 INTO wa_pa0001.
wa_pa0001-pernr(3) = '123'.
wa_pa0001-werks = '4711'.
MODIFY it_pa0001 FROM wa_pa0001.
ENDLOOP.
**** Problem!! Wie bekomme ich die Daten der internen Tabelle it_pa0001 im
**** korrekten Format in die interne Tabelle it_modify_0001
**** Achtung! Die Tabelle it_modify_0001 besitzt eine andere Struktur!!!!
*--- Daten des Infotypen erneut in IDoc-Format konvertieren ---*
CALL FUNCTION 'RH_PNNNN_IDOCSDATA_CONVERT'
EXPORTING
act_pnnnn = it_modify_0001
act_infty = it_modify_0001-infty
act_subty = it_modify_0001-subty
IMPORTING
act_idoc = sdata_data
act_idoc_name = it_out_hrobjsdata-segnam
TABLES
error_message = it_error_message
EXCEPTIONS
pnnnn_not_active = 1
idoc_not_active = 2
padnn_not_active = 3
pnnnn_too_short = 4
idoc_too_short = 5
padnn_too_short = 6
conversion_error = 7
OTHERS = 8.
IF sy-subrc NE 0.
*Errorhandling
ENDIF.