on 2016 Feb 10 4:11 PM
Hi Gurus,
I have a requirement where I need to write a routine in Update rules. Its 3.5 data flow. I don't have SOURCE_PACKAGE and RESULT_PACKAGE structure available.
I looked around and whatever examples I found were only 'Deleting' the entries from DATA_PACKAGE. My requirement is based on Two source Structure column, I have to pass results in Target structure column. This is to address 'an arithmetic error' in 2LIS_13_VDKON. I created another thread but there was no new answers hence creating new one and closed that one.
One of the answers which I got in my previous thread, suggested me to write a routine and I tried. (see below). But my question is how would I refer to Target Structure column in Update rules because DATA_PACKAGE is source structure.
DATA: WA_DATA_PACKAGE LIKE DATA_PACKAGE,
* ZCRATE LIKE SY-TABIX.
*LOOP AT DATA_PACKAGE INTO WA_DATA_PACKAGE.
* CLEAR ZCRATE.
* ZCRATE = SY-TABIX.
* IF WA_DATA_PACKAGE-INV_QTY <>'0'.
* DATA_PACKAGE-KPRICE = DATA_PACKAGE-KNVAL / DATA_PACKAGE-INV_QTY.
* ELSEIF
* DATA_PACKAGE-KPRICE = '0'.
* ENDIF.
* ENDLOOP.
Please help.
Regards
Prashant
Hi Prashant,
DATA_PACKAGE is the source and the target in the start routine. You just have to update it to make it work.
Your routine don't work because you don't update the internal table DATA_PACKAGE (you only update the header of the internal table).
Regards,
Frederic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a global internal table. This table should have all the key fields of the target DSO and also the target field.
Then, each time you LOOP at DATA_PACKAGE in your start routine, insert a record into this global itab, filling up the key fields and the target field.
Then write a field-level routine for the target field. It should lookup the global itab based on the key fields and get the value and populate it to the RESULT variable.
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.