cancel
Showing results for 
Search instead for 
Did you mean: 

generic extractor question

Former Member
0 Kudos

Hi all!

I have a question about a genereric extractor I'm working on. I want to have the results of my following code (under * Fetch records into interface table.- available in e_t_data (append e_t_data). I have no idea how to do this, can somebody help me out?

      OPEN CURSOR WITH HOLD s_cursor FOR
      SELECT *

      FROM /bic/al_itm1c00
         WHERE /bic/l_loaddat IN r_udate.

    ENDIF.


*
*   Fetch records into interface table.
*

* Fetch records into interface table.

    IF c EQ space.        "all new entries
      FETCH NEXT CURSOR s_cursor
                 APPENDING CORRESPONDING FIELDS
                 OF TABLE i_itm1_c
                 PACKAGE SIZE s_s_if-maxsize.
      IF sy-subrc <> 0.
        CLOSE CURSOR s_cursor.
        c = 'X'.
      ENDIF.
    ENDIF.

    IF c EQ 'X'.
      IF   sy-tcode NE 'RSA3' OR sy-batch EQ 'X'  .
        zbw_load_date-mandt      = sy-mandt.
        zbw_load_date-datasource = 'ZBW_YLSRCCON_DS'.
        zbw_load_date-bwdate     = sy-datum.
        MODIFY zbw_load_date.
      ENDIF.

      RAISE no_more_data.
    ENDIF.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

an example would really help me

thanks already!

ps: some points already rewarded

former_member188972
Active Contributor
0 Kudos

your e-mail?

Former Member
0 Kudos

you can post it here if you want?

former_member188972
Active Contributor
0 Kudos

Here only the main part:

..................

..................

OPEN CURSOR WITH HOLD S_CURSOR FOR

SELECT (S_S_IF-T_FIELDS) FROM /BIC/PMDCHSKU

WHERE /BIC/MDCHSKU in L_R_SKU

and OBJVERS eq 'A'.

ENDIF. "First data package ?

  • Fetch records into interface table.

  • named E_T_'Name of extract structure'.

FETCH NEXT CURSOR S_CURSOR

APPENDING CORRESPONDING FIELDS

OF TABLE T_DATA

PACKAGE SIZE S_S_IF-MAXSIZE.

IF SY-SUBRC <> 0.

CLOSE CURSOR S_CURSOR.

RAISE NO_MORE_DATA.

ENDIF.

loop at t_data.

Parte = t_data-/BIC/MDCHSKU+6(5).

Modello = t_data-/BIC/MDCHSKU(6).

W_data = t_data.

select single * from /BIC/PMDCHPARTE into corresponding fields of W_data

where /BIC/MDCHPARTE = Parte

and /BIC/MDCHMOD = Modello

and /BIC/MDCHCOMCL ne ' '

and OBJVERS eq 'A'.

select single * from /BIC/PMDCHMOD into corresponding fields of W_data

where /BIC/MDCHMOD = Modello

and /BIC/MDCHBRAND ne ' '

and OBJVERS eq 'A'.

W_data-/BIC/MDCHSKU = t_data-/BIC/MDCHSKU.

if w_data-/BIC/MDCHVARTY is initial.

w_data-/BIC/MDCHVARTY = ' '.

endif.

if w_data-/BIC/MDCHVAR is initial.

w_data-/BIC/MDCHVAR = ' '.

endif.

append w_data to e_t_data.

endloop.

refresh t_data.

S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.

ENDIF. "Initialization mode or data extraction ?

ENDFUNCTION.

Former Member
0 Kudos

I tried adding a line under my cursor code like

append i_itm1_c to e_t_data.

but this gives me the error

"One of the lines in "E_T_DATA" and "I_ITM1_C" is not mutually convertible. In Unicode Systems, the lines of "E_T_DATA" must have the same structure layout (fragment view) as "I_ITM1_C"

I'm new to ABAP , so I really don't know how I can solve my issue

thanks for the code already

former_member188972
Active Contributor
0 Kudos

How you have defined the data structure of the E_T_DATA?

Which kind of data of "I_ITM1_C" you must update in your generic datasource?

I don't know your requirements about this generic datasource!

So, you have to move or transform the data from the source to E_T_DATA depending to your requirements.

A simple:

data w_data like line of e_t_data.

......

move-corresponding I_ITM1_C to w_data.

append w_data to E_T_DATA.

.....

could be not enougth.

Former Member
0 Kudos

yep, that was all I needed to do! just move from to!

thanks a lot...

Answers (1)

Answers (1)

former_member188972
Active Contributor
0 Kudos

HI Joris,

with the code described by you, you have the results in the internal table "i_itm1_c", then you must add these records to the table e_t_data making transformation (if required).

Pay attention to:

the fetch is called per every data-package, so you have different time the adding data in i_itm1_c. Normally I prefer to refresh the internal table before to add new data (i_itm1_c and not e_t_data).

If you need an example I can give you an example code.

regards,

Sergio