‎2008 Apr 16 9:41 AM
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.
‎2008 Apr 16 10:01 AM
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.
‎2008 Apr 16 9:51 AM
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.
‎2008 Apr 16 9:56 AM
the bold statement is a macro which is stored in table trmac.
and... actually i do not understand your problem.
‎2008 Apr 16 10:01 AM
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.
‎2008 Apr 16 10:23 AM
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