Application Development and Automation 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: 
Read only

HR Abap code

Former Member
0 Likes
692

Hi all,

loop at itab where SPKZL = 'TDE2'. 

   *rp-provide-from-last P0770 '003' pnpbegda pnpendda.*

  concatenate 'Pers. No: ' itab-pernr 'Passport No: ' P0770-dlnum
    into body separated by space.
  append body.
  clear body.append body.
 endloop.

where to put the the bold statement in above code.

I want to get the p0770-dlnum and hence writed this sentence.

But I do not know how it runs.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
649

I think UR using LDB's and U R declaring 0770 in the infotypes

statement.

You need to write this statement after the GET PERNR event.

INFOTYPES : 0770.

start-of-selection.

GET PERNR.

rp-provide-from-last P0770 '0003' pnpbegda pnpendda.

loop at itab where SPKZL = 'TDE2'.

concatenate 'Pers. No: ' itab-pernr 'Passport No: ' P0770-dlnum

into body separated by space.

append body.

clear body.

append body.

endloop.

4 REPLIES 4
Read only

Former Member
0 Likes
649

It maybe some macro statement with three parameters.

Try to double click on rp-provide-from-last, it may navigate to the correponding macro where u can get the logic.

Read only

rainer_hbenthal
Active Contributor
0 Likes
649

the bold statement is a macro which is stored in table trmac.

and... actually i do not understand your problem.

Read only

Former Member
0 Likes
650

I think UR using LDB's and U R declaring 0770 in the infotypes

statement.

You need to write this statement after the GET PERNR event.

INFOTYPES : 0770.

start-of-selection.

GET PERNR.

rp-provide-from-last P0770 '0003' pnpbegda pnpendda.

loop at itab where SPKZL = 'TDE2'.

concatenate 'Pers. No: ' itab-pernr 'Passport No: ' P0770-dlnum

into body separated by space.

append body.

clear body.

append body.

endloop.

Read only

vladimir_golovtchiner
Participant
0 Likes
649

Hi,

loop at itab where SPKZL = 'TDE2'.

rp-provide-from-last P0770 '003' pnpbegda pnpendda.

concatenate 'Pers. No: ' itab-pernr 'Passport No: ' P0770-dlnum

into body separated by space.

append body.

clear body.append body.

endloop.

the Macro rp-provide-from-last reads tha table P0770 and if it will find something you will have a value in field P0770-dlnum. You use CONCATENATE to assemble the sentence - this is ok. But BODY is variable from type CHAR or STRING that after CONCATENATE statement has a value

"Pers.No: XXXXXX Passport No: YYYYYYYYYYYY". On the next loop it will be overwritten.

I would write something like that.

data: begin of body occurs 10,

sentence(50), " How long can be the sentence

end of body.

                  • other code using LDB *****

clear body. refresh body.

loop at itab where SPKZL = 'TDE2'.

rp-provide-from-last P0770 '003' pnpbegda pnpendda.

concatenate 'Pers. No: ' itab-pernr 'Passport No: ' P0770-dlnum

into body-sentence separated by space.

append body.

clear body.

endloop.

***************

So after that you will have an internal table BODY with one field BODY-sentence per each row in table itab.

Best regards

Vladimir