cancel
Showing results for 
Search instead for 
Did you mean: 

Adding append structure to the Extractor

Former Member
0 Kudos

Hi

I have added an append sturcture to my Data Source.

Now what/where should I do to populate my append structure.

How do I include the new append/extract structure in the user exit.

Kindly guide through.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Here is an option:

in the include given by SAP ZXRSAU01, write a piece of code where you dynamically call another program depending on your datasource.

Using this way, the include ZXRSAU01 becomes static and you just have to write one program by datasource.

Here are some samples to call another program and wht you should find in the program dedicated to the datasource:

*In the include*

DATA: PNAME LIKE TRDIR-NAME VALUE 'ZBWTX_',

RNAME(80) TYPE C VALUE 'EXZBWTX_',

W_NB_REC TYPE I.

CONCATENATE PNAME I_DATASOURCE INTO PNAME .

SELECT SINGLE NAME INTO PNAME FROM TRDIR

WHERE NAME EQ PNAME.

IF SY-SUBRC EQ 0.

DESCRIBE TABLE C_T_DATA LINES W_NB_REC.

IF W_NB_REC > 0.

CONCATENATE RNAME I_DATASOURCE INTO RNAME.

PERFORM (RNAME) IN PROGRAM (PNAME) TABLES

I_T_SELECT

I_T_FIELDS

C_T_DATA

C_T_MESSAGES

USING

I_DATASOURCE

I_ISOURCE

I_UPDMODE.

ENDIF.

Example of report :

REPORT ZBWTX_0CO_OM_NAE_2.

FORM EXZBWTX_0CO_OM_NAE_2 TABLES I_T_SELECT

I_T_FIELDS

C_T_DATA

C_T_MESSAGES

USING I_DATASOURCE

I_ISOURCE

I_UPDMODE.

"Put your code here"

ENDFORM.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

If you append it to the extrcat structure, all the added fields are available in the user exit. And this is where you populate the values of those fields by record if necessary.

I say necessary because for some extractors if you added fields that are part of the source table of the extractor and the new fields have the same name as in the original table, the values might be automatically populated.

Hope it helps

PYG

Former Member
0 Kudos

Thanks. but i want to know where do I write a new INCLUDE .

I have to use EXIT_SAPLRSAP_001. Then INCLUDE ZXRSAU01.

But inside this I have to write another include that specifically fills my fields.

Where/How do I do this.