on ‎2015 Oct 13 4:57 AM
I need your help in trying to figure out what I'm doing wrong here when trying to write code in the user exit for a data source enhancement requirement. Its my first time writing any code so please bear with me and any help is greatly appreciated. The scenario/requirement and the code I've written is below.
Some points I want to make are:
Again thank you for your help.
Enhance 0CUSTOMER_ATTR to bring in the following fields into the data source:
· KNB1-BUKRS; KNB1-ZTERM
The code i have written is:
*Define Structure
TYPES: BEGIN OF TYP_KNB1,
KUNNR TYPE KUNNR,
BUKRS TYPE BUKRS,
DZTERM TYPE DZTERM,
END OF TYP_KNB1.
* Declare Internal Table
DATA: GT_KNB1 TYPE STANDARD TABLE OF TYP_KNB1.
FIELD-SYMBOLS: <fs_knb1> TYPE TYP_KNB1,
<fs_data1> TYPE BIW_KNA1_S.
* Select data from db table into the internal table
IF NOT i_t_data[] is initial.
SELECT KUNNR
BUKRS
ZTERM
From KNB1
INTO table GT_KNB1.
IF SY-SUBRC = 0.
SORT GT_KNB1 by KUNNR.
ENDIF.
* Populate the enhanced fields.
LOOP AT i_t_data ASSIGNING <fs_data1>.
READ TABLE GT_KNB1 ASSIGNING <fs_knb1>
WITH KEY KUNNR = <fs_data1>-kunnr
BINARY SEARCH.
IF SY-SUBRC = 0.
<fs_data1>-ZBUKRS16 = <fs_knb1>-BUKRS.
<fs_data1>-ZZTERM16 = <fs_knb1>-ZTERM.
ENDIF.
ENDLOOP.
ENDIF.
Request clarification before answering.
Hi,
Have you removed the hide check box from the data soruce via RSO2 or RSA6 ?
Did you already put a break point in your code and checked in debug and see the data getting populated ?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.