Quantcast
Channel: SCN : Unanswered Discussions - ABAP Development
Viewing all articles
Browse latest Browse all 8768

Help with simple ABAP code for extractor 2LIS_02_SCL

$
0
0

Hi guys,

 

I hope someone can help me out here. My ABAP is almost next to zero and I need a very simple code written for enhancing an ECC extractor 2LIS_02_SCL.

 

The requirement is: You look up Requisition number AND Requisition line item number from EKPO.  Using both Req number (BANFN) and line item of the req number (BNFPO) you look up EBAN.  This will guarantee that you get one and only one record from EBAN.  Also keep in mind you should use the SE19 badi implementation for this.  Old method is cmod way, we are moving away from that and will use the object oriented approach for extractor enhancements.

 

So I have to write code using the approach of FIELD-SYMBOLS, etc that will work with BADI implementation. Look at the sample code below that I believe will give an idea of how we expect the code to look like. Will appreciate all the help!

 

method _TEMPLATE_DATASOURCE.

 

* Data Definition

* DATA: lth_vbak type hashed table of vbak

* with unique key vbeln,

* ls_vbak type vbak .

 

* FIELD-SYMBOLS: <L_S_DATA> TYPE <Extract structure name>.

 

* Init

* Perform always a mass select into an internal table

* SELECT * FROM VBAK INTO TABLE lth_vbak

* FOR ALL ENTRIES IN C_T_DATA

* WHERE VBELN = C_T_DATA_VBELN.

 

* map the data

* LOOP AT C_T_DATA ASSIGNING <L_S_DATA>.

* READ TABLE lth_vbak into ls_vbak

* with table key vbeln = <L_S_DATA>-vbeln.

* if sy-subrc eq 0.

* <L_S_DATA>-VKORG = ls_vbak-vkorg.

* !!! No MODIFY necessary as the field is changed immediatly in the

* internal table by using Field Symbols

* endif.

* ENDLOOP.

 

endmethod.


Viewing all articles
Browse latest Browse all 8768

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>