Application Development 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: 

Logic Problem in HR-ABAP...

Former Member
0 Kudos

Hi Experts,

i am developing outbound interface in HR module. in that i got stckup.

i ve Ztable like YSHR_NRIC there are some ICNUM and in my code every PERNR which am reading

through GET pernr. i want to compare my current Pernr(ICNUM) with YSHR_NRIC table ICNUM, if my

curreny ICNUM is there in my Ztable, then i want Bypass the pernr.

if not there in Ztable then i want to INSERT my Current Pernr-icnum into Ztable...

how can i procede in this ...i need logic...

Thanks in advance...

sudeer.

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

Hi,


GET PERNR.
READ TABLE yshr_nric WITH KEY icnum = pernr-icnum.
if sy-subrc = 0.
  "it is there, then bypass
  REJECT.
else.
  "is not there, then insert
  yshr_nric-icnum = pernr-icnum.
  INSERT yshr_nric INTO TABLE yshr_nric.   
endif.

Regards

Marcin

3 REPLIES 3

MarcinPciak
Active Contributor
0 Kudos

Hi,


GET PERNR.
READ TABLE yshr_nric WITH KEY icnum = pernr-icnum.
if sy-subrc = 0.
  "it is there, then bypass
  REJECT.
else.
  "is not there, then insert
  yshr_nric-icnum = pernr-icnum.
  INSERT yshr_nric INTO TABLE yshr_nric.   
endif.

Regards

Marcin

0 Kudos

Hi Marcin,

thank you verymuch for ur replay. and here i have doubt.

i.e suppose in my Ztable i ve 10 (ICNUM) records, if i use Read statement will it be compare with all 10 recors r not?

bcoz in my case i should compare with all 10 (ICNUM)records with current ICNUM. then it will be inserted into Ztable...

Thanks & Regards,

sudeer.

0 Kudos

Hi sudeer,

Yes it will check all 10 records against your ICNUM, so you will be sure wheter the entry is inside or not.

Regards

Marcin