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

Enhancing datasource 0vendor .

Former Member
0 Likes
384

Hi Experts,

I need to enhance datasource 0VENDOR_ATTR with e-mail address of the vendor. Email address can be obtained from ADR6 table.

We can directly link both tables LFA1 and ADR6.

ADDRNUMBER - is the joining field in both these tables to determine the mail address of the vendor.

ADRNR field in the lfa1 table and ADDRNUMBER field in ADR6 table.

The logic will be as follows

*Selecting the ADRNE from LFA1...

SELECT SINGLE ADRNR FROM LFA1 INTO I_ADRNR

WHERE LIFNR = ITAB-LIFNR.

*Passing ADRNR to ADR6 to get Email...

SELECT SMTP_ADDR INTO TABLE I_Z1EMAIL

FROM ADR6 WHERE ADDRNUMBER = I_ADRNR.

I dont have much knowledge in ABAP so experts please help me in completing this code in the enhancement EXIT_SAPLRSAP_002 .

CASE i_datasource. When '0vendor_ATTR'.

???????????????

??????????????

??????????????

SELECT SINGLE ADRNR FROM LFA1 INTO I_ADRNR

WHERE LIFNR = ITAB-LIFNR.

SELECT SMTP_ADDR INTO TABLE I_Z1EMAIL

FROM ADR6 WHERE ADDRNUMBER = I_ADRNR.

??????????????????????????

????????????????????????

???????????????????????.

Any help would be greatly appriciated.

Thanks in advance

1 REPLY 1
Read only

RaymondGiuseppi
Active Contributor
0 Likes
303

Sample

* Include ZXRSAU02. " master data enhancement
CASE i_datasource.
  WHEN '0VENDOR_ATTR'.
    PERFORM 0vendor_attr TABLES i_t_data.
ENDCASE.
* Include ZXRSAZZZ. " Subprograms and Modules
FORM 0vendor_attr TABLES itab.
  DATA: itab  TYPE TABLE OF biw_lfa1_s,
        record TYPE biw_lfa1_s.
  " Here select required data from LFA1, ADR6 into itab for values received
  LOOP AT itab INTO record.
    " Here read the itab and map data
    MODIFY itab FROM biw_lfa1_s.
  ENDLOOP.
ENDFORM.

Read [SELECT|http://help.sap.com/abapdocu_70/en/ABAPSELECT.htm]/[FOR ALL ENTRIES|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_ITAB.htm] and [READ TABLE|http://help.sap.com/abapdocu_70/en/ABAPREAD_TABLE.htm] documentation.

Regards,

Raymond