Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Enhance BW Extractor -abap coding error

Former Member
0 Likes
1,077

hi gurus

i need to enhance extractor 0customer_attr so that field from KNKK-GRUPP is pulled in along with 0customer_attr extraction

so i enhance the extractor using append and type it in the data element, PROVIDED zzxyzno in the field name

Activated it and UNHIDE it.

now my abap code in CMOD in ZXRSAU01 for EXIT RS*01 DOESNT WORK...

now i wrote below code:

DATA: L_S_INFOSTRU LIKE biw_kna1_s.

CASE I_DATASOURCE.

WHEN '0ustomer_attr'.

DATA: biw_kna1_s_data LIKE biw_kna1_s.

LOOP AT C_T_DATA INTO L_S_INFOSTRU.

L_TABIX = SY-TABIX.

biw_kna1_s_data-ZZXYZNO = KNKK-GRUPP

ENDLOOP.

ENDCASE.

but it is still not pulling in values from extractor...

can you please correct my code ???

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,038

Some code is missing

- where did you read the data from KNKK (where is the SELECT FROM KNKK)

- where did you udpate the internal table (where is the MODIFY, you could also use an ASSIGN)

Regards,

Raymon

8 REPLIES 8
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,039

Some code is missing

- where did you read the data from KNKK (where is the SELECT FROM KNKK)

- where did you udpate the internal table (where is the MODIFY, you could also use an ASSIGN)

Regards,

Raymon

Read only

0 Likes
1,038

THANKS Raymond

i am newbie and i am trying to learn ABAP

can you please provide me missing code

i tried tos earch sdn but couldnt find the code that is required for me??

appreciate ur help..

Read only

0 Likes
1,038

Try something like

FIELD-SYMBOLS: <customer_attr> TYPE biw_kna1_s.

CASE i_datasource.
  WHEN '0CUSTOMER_ATTR'. " Upper case
    LOOP AT c_t_data ASSIGNING <customer_attr>.
      SELECT grupp INTO <customer_attr>-zzxyzno
        FROM knkk UP TO 1 ROWS
        WHERE kunnr = <customer_attr>-kunnr.
      ENDSELECT. " not whole primary key
    ENDLOOP.
ENDCASE.

If performance problems arise ("SELECT in a LOOP"), first fill an internal table with a FOR ALL ENTRIES IN c_t_data in a sorted internal table (kunnr and grupp field, key kunnr) , then in the LOOP use a READ TABLE. (mandatory if you use such exits on big extractions.

Regards,

Raymond

Read only

0 Likes
1,038

What do i have to type here "<customer_attr>"

should it be 0CUSTOMER_ATTR

or should it be zzxyzno or BIW_KNA1_S

or jsut copy paste the code as zzxyzno

Read only

0 Likes
1,038

Type it exactly as i did, this is a [FIELD-SYMBOLS|http://help.sap.com/abapdocu_70/en/ABAPFIELD-SYMBOLS.htm] when used in a LOOP AT internal table ASSIGNING <fs> the field-symbol points to the actual line of the internal table, so no need to use any MODIFY statement to update the record. Those are also most useful when using dynamic structure only known at execution time.

Regards,

Raymond

Read only

0 Likes
1,038

Here is the code

DATA: L_S_INFOSTRU LIKE biw_kna1_s.

CASE I_DATASOURCE.

FIELD-SYMBOLS: <customer_attr> TYPE biw_kna1_s.

CASE i_datasource.

WHEN '0CUSTOMER_ATTR'. " Upper case

LOOP AT c_t_data ASSIGNING <customer_attr>.

SELECT grupp INTO <customer_attr>-zzxyzno

FROM knkk UP TO 1 ROWS

WHERE kunnr = <customer_attr>-kunnr.

ENDSELECT. " not whole primary key

ENDLOOP.

ENDCASE.

It gives me error that KUNNR is unknown...

this is how the code is in cmod

Edited by: Hem Bhatt on Oct 14, 2010 9:34 AM

Read only

0 Likes
1,038

Correct exit is ZXRSAU02 "Master Data" (like 0CUSTOMER_ATTR) , ZXRSAU01 is for "Transaction Data" (like 0FI_AR_3)

Nevertheless, when i add the sample to my include, there is no syntax error (kunnr exist in KNKK and biw_kna1_s, so your message is strange. Check for missing or extra ".", is there more code in your include, or any other include of the function group, try to perform a syntax check of the whole FM XRSA (Program SAPLXRSA)

Regards,

Raymond

Read only

0 Likes
1,038

thanks

it works

i had error for ".:"

i also have need for transaction data cmod i am posting it in new thread please reply....