Skip to Content
0

BW end routine lookup issue.

Jul 31, 2017 at 11:30 AM

77

avatar image
Former Member

Hi Team,

I'm trying to lookup in end routine:

1. Source Table (DSO) is : ZDSO_SLS

2. Target Table (Cube) is : ZIC_SLESS.

3. Lookup Table (DSO) is : ZDSO_NS

While loading from Source (ZDSO_SLS) to the Target (ZIC_SLESS), I have written end routine which is trying to fetch records of 'ZCUSTD' field from the lookup DSO (

ZDSO_NS).

But its giving me a dump " GETWA_NOT_ASSIGNED " while executing DTP. Please see the dump screen shot below:

And below is the end routine code, request you to kindly check the code and suggest what went wrong:

TYPES: BEGIN OF TY_NS,
ZCUSTD TYPE /BIC/AZDSO_NS00-/BIC/ZCUSTD,
ZCOMPC TYPE /BIC/AZDSO_NS00-/BIC/ZCOMPC,
ZCNTRYS TYPE /BIC/AZDSO_NS00-/BIC/ZCNTRYS,
ZSALORGS TYPE /BIC/AZDSO_NS00-/BIC/ZSALORGS,
END OF TY_NS.

DATA IT_NS TYPE TABLE OF TY_NS.
DATA IS_NS LIKE LINE OF IT_NS.

SELECT /BIC/ZCUSTD /BIC/ZCOMPC FROM /BIC/AZDSO_NS00 INTO TABLE IT_NS.
DATA N TYPE I.
LOOP AT RESULT_PACKAGE INTO <RESULT_FIELDS>.
READ TABLE IT_NS INTO IS_NS
WITH KEY ZCOMPC = <RESULT_FIELDS>-/BIC/ZCOMPC.
IF SY-SUBRC = 0.
<RESULT_FIELDS>-/BIC/ZCUSTD = IS_NS-ZCUSTD.
MODIFY RESULT_PACKAGE FROM <RESULT_FIELDS> INDEX N.
ENDIF.
ENDLOOP.

Thanks In Advance,

Ubaid.

9mbwv.png (14.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Best Answer
avatar image
Former Member Aug 01, 2017 at 07:28 AM
-1

Or try below simple code:

$*$ begin of 2nd part global - insert your code only below this line *
... "insert your code here
TABLES : /BIC/AZDSO_NS00
*$*$ end of 2nd part global - insert your code only before this line *

$*$ begin of routine - insert your code only below this line *-*
... "insert your code here

LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
SELECT SINGLE /BIC/ZCUSTD INTO <RESULT_FIELDS>-/BIC/ZCUSTD FROM

/BIC/AZDSO_NS00 WHERE ZCOMPC = <RESULT_FIELDS>-ZCOMPC.

ENDLOOP.

Thanks & Regards,

Kumar.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 01, 2017 at 06:49 AM
0

Hi Ubaid,

Can you please try with below statement:

SELECT /BIC/ZCUSTD /BIC/ZCOMPC FROM /BIC/AZDSO_NS00 INTO CORRESPONDING FIELD OF TABLE IT_NS.

Thanks

Mohit Agrawal

Share
10 |10000 characters needed characters left characters exceeded
Koen Hesters Aug 02, 2017 at 08:05 AM
0

Hi first of all do not add routines between DSO and Cube, add an extra DSO in your flow to have a nice 1 to 1 relation between DSO and Cube

secondly is there a one to one Relatinship CompC-CUSTD if yes use code underneath, if not do you want to generate all CUSTID in your data ?

DATA IT_NS TYPE HASHED TABLE OF TY_NS
               WITH UNIQUE KEY /BIC/ZCOMPC.
FIELD-SYMBOLS <NS> like line of it_ns.
.....your code....but change the loop by...
LOOP AT RESULT_PACKAGE INTO <RESULT_FIELDS>.
        UNASSIGN <NS>
READ TABLE IT_NS ASSIGNING <NS>
WITH TABLE KEY ZCOMPC = <RESULT_FIELDS>-/BIC/ZCOMPC.
IF <NS> IS ASSIGNED.
MOVE <NS>-ZCUSTD TO <RESULT_FIELDS>-/BIC/ZCUSTD.
ENDIF.
ENDLOOP.
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 01, 2017 at 07:09 AM
0

Hi Ubaid,

Try below code:

TYPES: BEGIN OF TY_NS,
ZCUSTD TYPE /BIC/AZDSO_NS00-/BIC/ZCUSTD,
ZCOMPC TYPE /BIC/AZDSO_NS00-/BIC/ZCOMPC,
ZCNTRYS TYPE /BIC/AZDSO_NS00-/BIC/ZCNTRYS,
ZSALORGS TYPE /BIC/AZDSO_NS00-/BIC/ZSALORGS,
END OF TY_NS.

DATA : IT_NS TYPE TABLE OF TY_NS,
IS_NS LIKE LINE OF IT_NS,

IT_FINAL TYPE STANDARD TABLE OF _TY_S_TG_1,
WA_FINAL TYPE _TY_S_TG_1.

IT_FINAL = RESULT_PACKAGE[].

SELECT /BIC/ZCUSTD /BIC/ZCOMPC FROM /BIC/AZDSO_NS00 INTO TABLE IT_NS for all entries in IT_FINAL where ZCOMPC = IT_FINAL-ZCOMPC.

LOOP AT IT_FINAL INTO WA_FINAL.

READ TABLE IT_NS INTO IS_NS WITH KEY ZCOMPC = WA_FINAL -/BIC/ZCOMPC.


IF SY-SUBRC = 0.
WA_FINAL -/BIC/ZCUSTD = IS_NS-ZCUSTD.
MODIFY IT_FINAL FROM WA_FINAL.
ENDIF.

CLEAR : WA_FINAL , IS_NS.
ENDLOOP.
REFRESH RESULT_PACKAGE[].
RESULT_PACKAGE[] = IT_FINAL.

Thanksℜgards,

Kumar.

Share
10 |10000 characters needed characters left characters exceeded
Loed Despuig Aug 09, 2017 at 02:36 AM
0

Is your problem already solved?

Regards,

Loed

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 23, 2017 at 10:13 AM
0

Hi All,

Thanks for the help. My problem is solved I missed Assigning Field Symbol statement in my code.

After using that its working fine.

LOOP AT RESULT_PACKAGE INTO <RESULT_FIELDS>. its wrong

correct one is

LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

Thanks again.

Ubaid.

Share
10 |10000 characters needed characters left characters exceeded