on 06-12-2014 7:37 PM
Hi,
I have a question. I need to calculate missing miles in the expert routine.
I'm not good in ABAP, I tried to write the code but i have problem to get continue with 1 record to another record. can please some one help me to write a code.
Thanks,
Master data of Function location
Function location From miles To miles
AB0001 500 600
Transaction data:
FL MDOC From miles Tomiles
AB0001 00001 504 510
AB0001 00001 522 526
AB0001 00001 560 566
In this Case missing miles are
Mismiles From Mismiles To
500 504
510 522
526 560
566 600
The Function location lenght could be start from 0 or 80 0r 110.....
Pria
Don't use the 'READ INTERNAL TABLE' because it only reads one (1) record.
Instead, do in a loop and append the records to another internal table, and at the end, set the
contents of the sp to = the appended internal table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Could you be a little more precise on what you're trying to do. What do you want to store in your target? Your transactional data and additional lines (the missing ones). If so, you can use a standard transformation and add entries in your source package in the start routine. If you don't feel at ease with ABAP it should be easier than using an expert routine.
Regards
Christophe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, something like this. Regards.
DATA: T_ABC TYPE TABLE OF STRUCTURE.
W_ABC LIKE LINE OF T_ABC.
SELECT FL
MDOC
MISSINGFROM
MISSINGTO
INTO TABLE T_ABC
FOR ALL ENTRIES IN SOURCE_PACKAGE
WHERE FL = SOURCE_PACKAGE-FL AND
MDOC = SOURCE_PACKAGE-MDOC.
IF SY-SUBRC EQ 0.
SORT T_ABC BY FL MDOC.
ENDIF.
LOOP SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.
READ TABLE T_ABC INTO W_ABC WITH KEY FL = <SOURCE_FIELDS>-FL
MDOC = <SOURCE_FIELDS>-MDOC
BINARY SEARCH.
IF SY-SUBRC EQ 0.
<SOURCE_FIELDS>-MISSINGFROM = W_ABC-MISSINGFROM.
<SOURCE_FIELDS>-MSSINGTO = W_ABC-MISSINGTO.
ENDIF.
ENDLOOP.
Hi,
Use Loop statement instead of read,
LOOP SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.
LOOP T_ABC INTO W_ABC WITH KEY FL = <SOURCE_FIELDS>-FL
MDOC = <SOURCE_FIELDS>-MDOC.
<SOURCE_FIELDS>-MISSINGFROM = W_ABC-MISSINGFROM.
<SOURCE_FIELDS>-MSSINGTO = W_ABC-MISSINGTO.
ENDLOOP.
ENDLOOP.
Read Statement = Reads only 1st records from the internal table.
Loop Statement = Reads all records form the internal Table.
Regards,
Poomagal S
Please reply me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.