Need ABAP Code to enhance the 0PRODORDER_ATTR?

I want to enhance the datasource 0PRODORDER_ATTR with the below JCDS Table fields like UDATE,STAT,OBJNR,INACT,CHGNR.
Can anyone please let me know the ABAP Code need to be written in the CMOD to populate the data for the above fields in the 0PRODORDER_ATTR?

Hi,
You can use below code to enhancemnt .
You need to change the table, structure and field names
Below code you have to write in tocde CMOD if you are enhancing the master data. It applies for any master data, although, I have taken 0VENDOR_ATTR as the example. I assume that You have already added/appended  the fields in the extract structure of 0VENDOR_ATTR  i.e. to the structure BIW_LFA1_S. ( Check this link for how to enhance the DataSource : https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0af763b-066e-2910-a784-dc6731660f46 )
We have enhanced the datasorce for the following two fields from table LFA1:
ERDAT- Date on which the Record Was Created
KRAUS - Credit information number.
We have also enhaced the structure for the following fields from table LFB1.
MINDK - Minority Indicators
ZTERM - Terms of payment key
CERDT - Certification date.
Now we will poulate these two fields in the code written in CMOD tcode. Here is the code:
Go to the tcode CMOD in R3 and select the component EXIT_SAPLRSAP_002. Write this code in INCLUDE ZXLOFU01.
data : l_t_data like biw_lfa1_s.
data : l_tabix like sy-tabix.
CASE i_datasource.
WHEN '0VENDOR_ATTR'.
    LOOP AT  i_t_data INTO l_t_data.
      l_tabix = sy-tabix.
      CLEAR:  l_t_data-yyerdat,
             l_t_data-yykraus.
      SELECT SINGLE  erdat kraus FROM lfa1 INTO
          ( l_t_data-yyerdat, l_t_data-yykraus)
            WHERE lifnr EQ l_t_data-lifnr.
      SELECT SINGLE mindk zterm cerdt FROM lfb1 INTO
              (l_t_data-yymindk, l_t_data-yyzterm, l_t_data-yycerdt)
              WHERE lifnr = l_t_data-lifnr.
      MODIFY i_t_data FROM l_t_data INDEX l_tabix.
      CLEAR: l_t_data, l_tabix.
    ENDLOOP.
ENDCASE.
Labels parameters

Similar Messages

  • Need help in ABAP code to Enhance the Extract Structure ?????

    Hi all,
        I want to enhance the extract structure to get KBETR & KBRUE fields of KONP table since it didn’t allow me to add those fields while creating the generic extractor because of currency key problems. I want to read all KONP records into internal table with KNUMH (Key). Next, I want to fill them into ZZKBETR & ZZKBRUE of Extract Structure ZOXUR40065 in loop.
    DATA:
      i_t_zrebate like ZOXUR40065 occurs 0 with header line,
      reb_tabix like sy-tabix.
    TABLES: KONP.
      Could you please help me in completing the ABAP code?
    Thanks,
    Venkat.

    Hello Manga,
        I have included the following code in ZXRSAU01:
    WHEN 'ZREBATE'.
    PERFORM ZREBATE_EXIT TABLES C_T_DATA.
    After Double click on ZREBATE_EXIT on perform statement, it created ZXRSAF01 include and the following code is added in it:
    FORM ZREBATE_EXIT TABLES FP_C_T_DATA STRUCTURE ZOXUR40065.
    DATA:
    i_t_zrebate like ZOXUR40065 occurs 0 with header line,
    reb_tabix like sy-tabix.
    FIELD-SYMBOLS: <l_c_t_data> TYPE ZOXUR40065.
    LOOP AT fp_c_t_data ASSIGNING <l_c_t_data>.
    reb_tabix = sy-tabix.
    select single KBETR KBRUE
    into (<l_c_t_data>-ZZKBETR,
    <l_c_t_data>-ZZKBRUE,
    from KONP
    where KNUMH eq <l_c_t_data>-KNUMH.
    if sy-subrc eq 0.
    MODIFY fp_c_t_data FROM <l_c_t_data> INDEX reb_tabix.
    endif.
    CLEAR:reb_tabix.
    ENDLOOP.
    ENDFORM.
    When I tried to Activate this ZXRSAF01 include, it fails with 'The FORM "ZREBATE_EXIT" does not exist'.
      Should it be FP_C_T  or P_C_T? I found P_C_T in ZXRSAF01 include.
      What is wrong with it, please ?
       Can't I add this whole code in main include ZXRSAU01itself?
      The Extractor ZREBATE is based on KONA, KONH & KONP tables. This Extractor and KONA table have the same 4000 records and KONP has 13000 records. I want to extract KBERT & KBRUE from KONP.
       Thanks in advance.
    Regards,
    Venkat

  • ABAP code to Enhance Master data

    Hi Friends,
    can  you send me a sample ABAP code to enhance the master data
    Regards
    Hari

    Dear Adluru Hari Varma ,
    Hereunder an example of code to enhance Master Data
    0ART_SALES_ATTR for 0MAT_SALES:
    EXIT_SAPLRSAP_002
    DATA: l_biw_mvke_s LIKE biw_mvke_s,
    l_tabix LIKE sy-tabix,
    v_satnr LIKE mara-satnr.
    CASE i_datasource.
    WHEN '0ART_SALES_ATTR'.
    LOOP AT i_t_data INTO l_biw_mvke_s.
    l_tabix = sy-tabix.
    clear v_satnr.
    SELECT SINGLE satnr FROM MARA INTO v_satnr
    where matnr = l_biw_mvke_s-matnr.
    IF sy-subrc = 0.
    l_biw_mvke_s-zzsatnr = v_satnr.
    ENDIF.
    MODIFY i_t_data FROM l_biw_mvke_s INDEX l_tabix.
    ENDLOOP.
    ENDCASE.
    Also
    the user exit code zxrsau02 to populate the new fields .say you add field zzfield1, user exit code zxrsau02 can be like
    data : l_s_custattr like BIW_KNA1_S,
    l_zzfield1 like tablexyz-fieldabc,
    l_tabix like sy-tabix.
    case i_datasource.
    when '0customer_attr'.
    loop at c_t_data into l_s_custattr.
    l_tabix = sy-tabix.
    fill the new field
    select single fieldabc into l_zzfield1
    where ....
    l_s_custattr-zzfield1 = l_zzfield1.
    modify c_t_data from l_s_custattr index l_tabix.
    endloop.
    take a look some links on enhancement
    Enhancement
    User exit
    and download pdf 'enhancements in sap bw'
    here you can find the steps ...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/59069d90-0201-0010-fd81-d5e11994d8b5
    hope this helps.
    Re: enhancements
    Check in SDN you will find more programs
    Hope it helps.Revert back to me if you have any queries
    Regards
    Bala

  • Need ABAP code for Datasource Enhancement

    Hi All,
    I need no Enhance the WBS Element(PS_PSP_PNR) to2 LIS_02_ITM Datasource
    the table EKKN Having WBS element
    From EKKN Table We have to take the filed Append to the2LIS_02_ITM datasource
    Please any one give me ABAP code which is write in CMOD
    Thanks........
    Regards!
    Malli

    Hi,
    See SAP Help
    http://help.sap.com/saphelp_nw04s/helpdata/en/6e/fe6e420f00d242e10000000a1550b0/content.htm
    See the simple example code, so follow the same.Take ABAPer help, don't use select and end select.
    CASE i_datasource.
      Data: l_s_data1 LIKE mc13vd0itm,
            l_tabix   LIKE sy-tabix,
      WHEN '2LIS_13_VDITM'.
        LOOP AT c_t_data INTO l_s_data1.
          l_tabix = sy-tabix.
          SELECT SINGLE auart INTO l_s_data1-zzprdtyp FROM vbak
                 WHERE  vbeln  = l_s_data1-aubel.
          IF sy-subrc = 0.
            MODIFY c_t_data FROM l_s_data1 INDEX l_tabix.
          ENDIF.
        ENDLOOP.
    ENDCASE.
    Data: l_s_data18 LIKE mc12vc0itm ,
          l_tabix   LIKE sy-tabix.
      WHEN '2LIS_12_VCITM' .
        LOOP AT c_t_data INTO l_s_data18.
          l_tabix = sy-tabix.
          SELECT SINGLE ernam FROM ekko
           INTO (l_s_data18-ernam)
           WHERE ebeln = l_s_data18-vgbel .
          IF sy-subrc = 0.
            MODIFY c_t_data FROM l_s_data18 INDEX l_tabix.
          ENDIF.
        ENDLOOP.
    See article on Step by Step Guide to Enhance a Data Source:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00c1f726-1dc2-2c10-f891-ddfbffdb1a46?quicklink=index&overridelayout=true
    Thanks
    Reddy

  • Need ABAP code for the below Services requirement

    Hi,
    We have a requirement to show all the services for a particular Purchase order number.For this I built a view on 2 tables ESLL and EKPO.Now based on the below logic I need to bring the services for the Purchase order..
    1.Enter PO number,item no. and Doc category in EKPO and find the Pack no.
    2.Now take the Pack no. of EKPO and give in ESLL and find the Sub pack no.
    3.Now take this Subpack no. and Give this sub pack as Pack no. in ESLL
    4.This will be the Service entry record for that PO number.
    Can any one Please suggest me to how to write the ABAP code for the above logic.
    Thanks & Regards,
    Dinakar

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

  • ABAP code to enhance a standard data source

    Hi BW experts,
    I am a novice in BW and I need to append a standard datasource <b>0DAT_SRC</b> with a field <b>FLD1</b> from table <b>TABL1</b>.Extract structure: <b>EX0001</b>.
    Can anybody please suggest how this can be done?I guess it requires some ABAP coding to be done in the conversion exits.
    <b><i>Many,many thanks in advance!!</i></b>

    Following are the steps to enhance Standard Data source.
    1. goto tc RSA6.
    2. Select the Data Source which you want to enhance.
    3. Select display Data Source (Ctr+f2)
    4. Double click on the Extract structure.
    5. click on the Append Structure.
    6. Add the required fieds starting with ZZ*.
    7. Avtivate the Append Structure.
    To populate the data into this field you must have a project created to access the FM 'EXIT_SAPLRSAP_001'.
    to Create Project code goto tcode: CMOD
    1. Enter the Project name and click on create
    2. go to components select the required function module.
    EXIT_SAPLRSAP_001 for Transactional DS (RSR000
    EXIT_SAPLRSAP_002 for Master DS
    Goto SE37 and enter the Respective Function module (ex . EXIT_SAPLRSAP_001) and click on the include zxxxxx. then write the code to populate the extra fields added to the DS.
    Sample code:
    CASE i_datasource.
    WHEN '2LIS_11_VAITM'.
    loop at c_t_data into work_ar.
    do some selections, some calculations ....
    append work_ar to c_t_data. " add a new record
    modify c_t_data from wa. " change the existing record
    endloop.
    endcase.

  • Abap Code TO ENHANCE DATASOURCE with KEY FIELD OF SOURCE TABLE

    Dear Friends, Please help me to resolve this important issue at my end.
    <b>Requirement</b>:  enhance the STRUCTURAL data source which is
    based on the table VISTSU , now this table has a <b>key INTERNO</b> (Data Element : SECAINTRENO) which i want to enhance in datasource 
    SGONR = STRUCTURAL NUMBER present in extract structure of datasource
    Solution: I am not able to see any records for zzinterno enhance field in datasource rsa3 (Extractor CHECKER). Can u help me correct the ABAP code or tell me the way to pull the records for ZZINTERNO from VISTSU table.
    Thanks
    Poonam Roy
    ABAP Code
    data: l_s_REIS_STRUCTURAL_ATTR like REIS_STRUCTURAL_ATTR.
    case i_datasource.
    WHEN '0STRUCTURAL_ATTR'.
    loop at C_t_data into l_s_REIS_STRUCTURAL_ATTR.
    l_tabix = sy-tabix.
    clear  I_VISTSU .
    select single * from VISTSU  into i_VISTSU  where SG0NR = l_s_REIS_STRUCTURAL_ATTR-SGONR.
    if sy-subrc = 0.
    l_s_REIS_STRUCTURAL_ATTR-ZZINTRENO = I_VISTSU -INTRENO.
    modify C_t_data from l_s_REIS_STRUCTURAL_ATTR index l_tabix.
    endif.
    endloop.
    endcase.

    Try the below code.
    data: l_s_REIS_STRUCTURAL_ATTR like REIS_STRUCTURAL_ATTR.
    data: temp_interno like VISTSU -INTRENO.
    data:  h_tabix LIKE sy-tabix.
    case i_datasource.
    WHEN '0STRUCTURAL_ATTR'.
    loop at C_t_data into l_s_REIS_STRUCTURAL_ATTR.
    MOVE SY-TABIX TO H_TABIX.
    clear temp_interno.
    select single INTERNO from VISTSU into temp_interno where SG0NR = l_s_REIS_STRUCTURAL_ATTR-SGONR.
    if sy-subrc = 0.
    l_s_REIS_STRUCTURAL_ATTR-ZZINTRENO = temp_interno.
    endif.
    modify C_t_data from l_s_REIS_STRUCTURAL_ATTR index H_TABIX.
    ENDLOOP.
    ENDCASE.
    Regards, Siva

  • Need ABAP code to make unique hierarchy values - Request prompt help

    hi
    <removed>
    I am new to SAP. Please help me in the following
    I require an ABAP code for the following scenario
    I have a simple hieraarchy. The hierarchy is
    SEG -> fam -> clas -> comm
    The values of the seg , fam, cla, com......all will be charecter values
    But in some cases the values will be NOT_KNOWN
    If the values are NOT_KNOWN i need to change them as NOT_KNOWN_1, NOT_KNOWN_2...like that unique charecter values
    should be replaced for NOT_KNOWN
    Example
    SEG->FAM->CLA ->COM
    Clothing -> Mens wear -> Designer garments -> NOT_KNOWN
    Construction -> equipments -> machinery->NOT_KNOWN
    Computers -> Laptops -> Imported -> NOT_KNOWN
                     -> desktops ->flat monitors -> Indian
                           -> imported                     -> NOT_KNOWN->
    NOT_KNOWN -> baggages
    This should be changed to
    SEG->FAM->CLA ->COM
    Clothing -> Mens wear -> Designer garments -> NOT_KNOWN_1
    Construction -> equipments -> machinery->NOT_KNOWN_2
    Computers -> Laptops -> Imported -> NOT_KNOWN_3
              -> desktops ->flat monitors -> Indian
                              -> imported                         
           -> NOT_KNOWN_4 ->
    NOT_KNOWN_5 -> baggages
    This is to make them unique nodes to upload them in hiereachy
    Data is coming from database tables and i was not supposed to do anything in database and the incomin
    data needs to finetuned like this to update them in cube
    So I like to have some coding which will enable this to work in the start routine
    If start routine is not the right option, where else we can do coding
    <removed>
    Regards
    KC

    data : w_suff_n(8) type n,
             w_suff_c(8).
    loop at data_package.
    if data_package-<fieldval> = 'NOT_KNOWN'.
      w_suff_n = w_suff_n + 1. w_suff_c = w_suff_n.
      shift w_suff_c left deleting leading '0'.
      concatenate data_package-<fieldval> w_suff_c into data_package-<fieldval>.
      modify data_package.
    endif.
    endloop.
    *Change <fieldval> in the above to the actual field name.

  • Need Abap Code Help

    Hi ,
    I am trying to activate an ODS but it is failing the activation process . When I look into the application log I see this error    "Value 'RAM???¿????????S RAM' (hex. '4D41524B3F3F3FBF3F3F3F3F3F3F3F3F5320574F524B') of characteristic ZEUID contains invalid characters "
    I am new to ABAP and I need an ABAP code to filter this value when loading data into ODS .
    Thanks a lot for your help

    HI,
      Write the code in the start routine.
      IN the start routine you have a table called SOURCE_PACKAGE.
      declare work area x_souce_package type source_package
    data : lv_string(100).
      loop at souce_package into x_source_package.
      lv_string =  x_source_package-value.
    TRANSLATE LV_STRING TO UPPER CASE
      if lv_string CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .
      ELSE.
      DELETE SOURCE_PACKAGE INDEX SY-TABIX.
      ENDIF.
      endloop

  • Executing Abap Queries in Abap Code and processing the result

    Hi,
    I want to execute ABAP Queries (designed by sq01) in an abap report and processing the result in an internal table.
    How could it be work?
    Thanks a lot for your responses,
    with kind Regards
    Reinhold Strobl

    Hello,
    GO to SQ01 and select your query. Go to Menu QUERY-->More Functions->Display Report Name.
    You can then take that report name and go to SE38. Copy the code before END-OF_SELECTION and then modify as per your own requirements.
    Regrads
    Saket Sharma

  • Need ABAP Code in BI routine

    Hi,
    I want to write a transfer routine, Can any one give me the ABAP Code...
    Here is what I want to do:
    1. Read by document Number at the Header level (identified by item = "#")
    2. Read the Status of the Header
    3. If the Status = deleted
    4. Read all the line items related to the Header
    5. Assign the Status of the line item = Status of the Header
    Thanks
    Edited by: tanu d on Aug 20, 2010 11:32 AM

    Hi,
    See the simple code.
    IF SOURCE_FIELDS-N_WBSEOM = ' '.
          RESULT = 'N'
        ELSE.
          RESULT = SOURCE_FIELDS-N_WBSEOM.
        ENDIF.
    OR
    IF SOURCE_FIELDS-N_WBSEOM IS INITIAL.
          RESULT = 'N'
        ELSE.
          RESULT = SOURCE_FIELDS-N_WBSEOM.
        ENDIF.
    Thanks
    Reddy
    Edited by: Surendra Reddy on Nov 25, 2009 5:38 AM

  • I have just bought an old ibook g3 and i need a code to change the region on the dvd drive . how can i get this ?, i have just bought an old ibook g3 and i need a code to change the region on the dvd drive . how can i get this ?

    i do not know the code to change the region on the dvd drive and it is stuck on region 1 and i need to change it to region 2. i am using an old ibook g3 , can any one help with the code

    You must have a G4 iBook as the G3 models can only install up to 10.4.11.
    Some links to read for possible help.
    https://discussions.apple.com/message/759882#759882
    https://discussions.apple.com/message/5083031#5083031
    https://discussions.apple.com/message/20461888#20461888

  • Abap code to replace the bank values of Date Field with 20990101

    Please correct my abap code I am just trying to replace the bank values of Dataefield to 20990101 but i am getting the error invalid dataformat '00000000 '. Please correct my IF statement so that I can get this resolved
    IF    SOURCE_FIELDS-DATETO = '00000000 '
          RESULT = '20990101'.
    ENDIF.
    Thanks'
    Soniya

    Hi Soniya,
    You can use one of the following:
    IF SOURCE_FIELDS-DATETO =  ' '.
    RESULT = '20990101'.
    ENDIF.
    or
    IF SOURCE_FIELDS-DATETO IS INITIAL.
    RESULT = '20990101'.
    ENDIF.
    or
    IF SOURCE_FIELDS-DATETO = '00000000'.
    " THERE WAS A SPACE IN YOUR CODE.
    RESULT = '20990101'.
    ENDIF.
    Regards,
    Satya

  • Need ABAP code for Routine

    Hi Gurus My requirement goes like this.
                                  I need to write the routine in Transformation from DSO to DSO
    Source table
    Doc         Amt         Netduedate      Reference Doc
    1000      10000     01.01.2010        
    1500       5000      30.01.2010        1000
    1700       3000      02.02.2010        1000  
    In the Above table 1st document is Invoice Document, 2nd and 3rd are Partial Payment Document.
    My requirement is 2nd and 3rd record Netduedate value should have 01.01.2010 by referring reference Doc field, for the above Ex We should have the output like this
    Target table
    Doc         Amt         Netduedate      Reference Doc
    1000      10000     01.01.2010        
    1500       5000      01.01.2010        1000
    1700       3000      01.01.2010        1000  
    Please give me the syntax code and where to write the code ie in the start routine or in the field routine. the dataflow is between one DSO to Another DSO
    Please Provide me the solution ASAP as this is very Urgency.
    Thanks in Advance

    If suppose your documents are being loaded in same load,
    1. start routine - create internal table like SOURCE_PACKAGE
    DATA IT_SOURCE_PACKAGE TYPE TABLE OF SOURCE_PACKAGE.
    DATA WA_SOURCE_PACKAGE LIKE LINE OF SOURCE_PACKAGE.
    2. copy all records to new internal table, IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[]
    3. delete partial docs, DELETE IT_SOURCE_PACKAGE WHERE REF_DOC IS NOT INITIAL.
    4. Sort internal table SORT IT_SOURCE_PACKAGE BY DOC
    5. Look for original doc inside loop.
    LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS> WHERE REF_DOC IS NOT INITIAL.
    READ TABLE IT_SOURCE_PACKAGE 
          INTO WA_SOURCE_PACKAGE
          WITH KEY DOC = <SOURCE_FIELDS>-REF_DOC  BINARY SEARCH.
    IF SYSUBRC EQ 0.
      <SOURCE_FIELDS>-NDUEDATE = WA_SOURCE_PACKAGE -NDUEDATE.
    ENDIF.
    ENDLOOP.
    If the original documents are found in different loads in the source DSO, we need to pull the records from active table of the target DSO after step 2.
    -Jijo

  • ABAP Store ABAP code locally  on the disk

    Hello
       I have a question, how download the Web dynpro ABAP code from the SAP System.
    Could You give me a hint how to save code locally on the disk?
    Regards
    Wojtek

    I started from http://code.google.com/p/saplink/ .
    Then in http://code.google.com/p/saplink/wiki/pluginList I found the plug-in for ABAP Web Dynpro.
    It still in ALPHA status and to be honest I got trouble installing it (in fact there is the note:  But WDA plugin requires SAPlink 0.1.3 or greater).
    You should get it running because I can see the nugg file.
    Eventually ask navigate to the http://code.google.com/p/saplink/issues/list and the other pages of http://code.google.com/p/saplink.
    Sergio

Maybe you are looking for

  • How can we reset the SAP cache for users roaming profile in a d?

    Our active directory is on windows server 2003. SAP version 6.40 users work from different workstations in our company with their roaming profile. printouts are defined by assigning a printer to the terminal (usually the closest terminal to theprinte

  • How to see how much hard drive space is free in my MacBook Pro

    I have a lot of music and am starting to use lossless files.  How can I check to see how much hard drive space I have free on my MacBook Pro?

  • I can't update itunes to 11.0.4 on windows 7

    I can't update itunes to 11.0.4. When I try to update a message pops up saying "the feature you are trying to use is on a network resource that is unavailable". The same thing happened with the last update. I had to uninstall and download the new ver

  • Generating Java wrappers for PL/SQL Packages in JDeveloper 3.1

    I have not been successful in using JD3.1 to generate java classes for use in calling PL/SQL packages from a Java Servlet I am developing. I have followed the directions under the 'Generating Java Code for Oracle Objects and PL/SQL Packages' help top

  • Bug Group by Outlook 2010 - Exchange 2013

    Hello, I work in an IT department. We have Office 2010 and we have just migrate in exchange 2013. I have a problem with Outlook 2010 (64 bits) : When you used the view Group By From, there are not refresh. When you read a mail, the mail remains not r