on 09-11-2015 9:25 AM
Hello Abaper,
¨
I need to fill two fields in target DSO from DataSource that is including only one Field. The other 2 Fields are already existing in another DSO. I know I can achieve that using Read from DSO in Rule Type but I need to know how to achieve that using Start Routine only. Why do not wanna use Rule Type Read from DSO ? Because in many cases we have more than one conditions for lookup which cannot be implemented using rule type Read from DSO.
I wrote the following code, how can I populate the data in target fields and how can I add the target fields into source_package or source_fields,
DATA: ITAB TYPE STANDARD TABLE OF /BIC/AZSE1DSO00,
WA_ITAB LIKE LINE OF ITAB.
SELECT /BIC/ZSECOMPC CURRENCY TXTMD
FROM /BIC/AZSE1DSO00 INTO CORRESPONDING FIELDS OF TABLE ITAB
FOR ALL ENTRIES IN RESULT_PACKAGE
WHERE /BIC/ZSECOMPC = RESULT_PACKAGE-/BIC/ZSECOMPC.
SORT ITAB ASCENDING BY /BIC/ZSECOMPC.
LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
LOOP AT ITAB INTO WA_ITAB WHERE
/BIC/ZSECOMPC = <RESULT_FIELDS>-/BIC/ZSECOMPC.
IF SY-SUBRC = 0.
<RESULT_FIELDS>-CURRENCY = WA_ITAB-CURRENCY.
<RESULT_FIELDS>-TXTMD = WA_ITAB-TXTMD.
ENDIF.
ENDLOOP.
ENDLOOP.
regards,
sherif
Hi,
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jugal,
I just wannted to avoid Fieldroutine in case you have many packages a 50k for instance. For this reason I asked about populating directly from Startroutine package by package.
Are you sure, that I would not work directly in Startroutine, I mean somehow declare targets fields in start routine and fill them?
rgds,
Sherif
My opinion NO . even if you declare them they are local inside that method (you can see this when you refer the generated program of your transformation).
For example in a class you have two method and inside that you have two variable with the same name. The value of one local is not be the same in another method ? .
In the field routine if you use binary search with the read statement it should be ok, else you can also go with using a # table and read the same in the field routine.
Thanks
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.