01-20-2015 9:22 AM
HI,
I am using PNP logical database and selection criteria of GET PERNR. In my code before get pernr , following code is used in my program. The output of this code is correct for single value of pnporgeh-low value but if i want to pass multiple values in pnporgeh than output is not coming as per my given values. There is need to put the LOOP instead of IF statement. SO please suggest and help me out.
IF NOT PNPORGEH IS INITIAL.
PERFORM get_orgeh.
ENDIF.
FORM get_orgeh .
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'O'
act_objid = pnporgeh-low
act_wegid = 'O-S-P_PM'
TABLES
result_tab = it_tab
result_objec = it_objec
result_struc = it_struc
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT it_objec BY otype objid DESCENDING.
DELETE ADJACENT DUPLICATES FROM it_objec COMPARING otype objid.
LOOP AT it_objec INTO wa_objec WHERE otype = 'P'.
it_objec1-sign = 'I'.
it_objec1-option = 'EQ'.
it_objec1-low = wa_objec-objid.
APPEND it_objec1.
ENDLOOP.
pnporgeh-sign = 'I'.
pnporgeh-option = 'EQ'.
LOOP AT it_objec INTO wa_objec WHERE otype = 'O'.
WRITE: / wa_objec-objid.
pnporgeh-low = wa_objec-objid.
APPEND pnporgeh.
ENDLOOP.
ENDFORM.
01-20-2015 9:29 AM
Hi,
you might want to post this in an ABAP coding related community, not this one.
http://scn.sap.com/community/abap
Thanks, Ulf.
01-20-2015 9:29 AM
Hi,
you might want to post this in an ABAP coding related community, not this one.
http://scn.sap.com/community/abap
Thanks, Ulf.
01-20-2015 10:01 AM