How to write enhancement logic for AR datasource

I need to enhance the AR data source(0FI_AR_4) with the following logic:
LOGIC:
First find out the KB Partner function in the field: KNVP-PARVW. Once the KB value is obtained, then display the value from KNVP-PERNR
Thanks..
Edited by: Jim kim on Jul 25, 2011 10:41 PM
Moderator message : Spec dumping not allowed. Thread locked.
Edited by: Vinod Kumar on Jul 26, 2011 10:18 AM

Hi Ram,
Generally the IDoc user exit is called at the following places:
  1) When the control record is read.
  2) After each and every segment in the data record
  3) At the end of the data segment processing.
The IDoc user exit interface generally imports IDOC_DATA (data record internal table) table. Now the data records in the internal table should appear in the same order as maintained while defining IDoc structure (WE30 transaction). For SAP standard segment SAP code will take care of this. For extended segment you will have to take care of this aspect by appending the Z-segment in the IDOC_DATA table.
You can do this by:
         looping at IDOC_DATA table:
             - Do a case-endcase fo IDOC_DATA-SEGNAM (This stores the segment 
               structure as per the hierarchy).
             - Within the case for "Z-segment" you can write the logic for appending
               the Z-segment to IDOC_DATA-SDATA.
Hope this gives some clue.
Regards,
Gajendra.

Similar Messages

  • How to write the logic for extending Idocs...

    Hi,
          Can anybody pls explain how to write the logic for extending IDOCs with an example...
          Good suggestions can be appreciated..
    Regards,
    Ram

    Hi Ram,
    Generally the IDoc user exit is called at the following places:
      1) When the control record is read.
      2) After each and every segment in the data record
      3) At the end of the data segment processing.
    The IDoc user exit interface generally imports IDOC_DATA (data record internal table) table. Now the data records in the internal table should appear in the same order as maintained while defining IDoc structure (WE30 transaction). For SAP standard segment SAP code will take care of this. For extended segment you will have to take care of this aspect by appending the Z-segment in the IDOC_DATA table.
    You can do this by:
             looping at IDOC_DATA table:
                 - Do a case-endcase fo IDOC_DATA-SEGNAM (This stores the segment 
                   structure as per the hierarchy).
                 - Within the case for "Z-segment" you can write the logic for appending
                   the Z-segment to IDOC_DATA-SDATA.
    Hope this gives some clue.
    Regards,
    Gajendra.

  • How to write Additional Logic IN SAP Query

    Hi All,
    I need to Add 1 more field in Query.
    How to Write a Logic in Infoset?
    For Ex : Need to add age field in the output.
    Thanks
    Partha.

    Hi,
    Refer to this link..Additional field in SAP Query
    [Creating Additional Fields |http://help.sap.com/saphelp_nw04/helpdata/en/d9/9958e0c50a11d396f80000e82de14a/frameset.htm]
    [Code|http://help.sap.com/saphelp_nw04/helpdata/en/d9/9958e0c50a11d396f80000e82de14a/frameset.htm]

  • How to write conversion routine for key figure?

    Our customer has this requirment:
    we need to know the last time of some TV program in BEx report, If a TV program last 500 seconds, we need show the key figure like this:  00:08:20, If a TV program last 100000 seconds, we need show the key figure like 27:46:40 (27 hours and 46 minitues and 27 seconds), If we define a key figure as time,  BW system will report a error that say it is not acceptable time.  If we want to define a integer, but we need display it like hhmmss format.  We know we can write conversion routine for char.  but I don't how to write conversion routine for key figure.   Please give me any hint if any other solutions?
    Edited by: SY DONG on Dec 2, 2010 3:36 AM

    If you want to do in Transformation Layer :
    You can use routine ...break up the seconds into minute hour and seconds
    you will have to handle few cases in this:
    let say your variable lv_seconds holds the number of seconds you want to convert to hour min and seconds
    DATA: lv_seconds type i,
               lv_hrs  type  i,
              lv_sec type i,
              lv_min type i.
    lv_hrs = lv_seconds / 3600
    if lv_hrs >= 1.
    lv_min = (lv_hrs - trunc(lv_hrs))*60
    here again handle seconds if min >60.
    else.
    lv_hrs = '00'.
    lv_min = lv_hrs*60
    It is just hint ..how you can manipulate the seconds to get it...you will have to think about the complete algorithm
    Regards,
    RK

  • How to write a code for  open new txt file in swing

    hai all,
    now i do one project in java.that project's GUI is Swing. But i don't known swing (basic).So how to write a code for open new txt file and "Open window " in menu item on swing.that means when i click the "New" on menu that time open a new txt file. open also like that type.
    plz give me that code ! very urgent
    Advance Thanks !
    RSK

    Swing Tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/index.html
    Since you don't know the basic of swing read the tutorial, it is for your own good because it is useless if we provide you with a code you don't even understand and how it works.
    If you want a menu read the tutorial about using menus and for opening a file read using JFileChooser.
    note: don't use the word urgent because it implies that your problem is more important than others.

  • How to write Select statement for this codition

    I need to check whether SGTXT contains BELNR value.
    SGTXT is a text field and It should be matched with BELNR
    How to write select statement for this.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT should have the given BELNR Value.
    Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.

    Hi,
    data temp(12).
    concatenate '%' belnr '%' into temp.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT like temp.
    If belnr is having multiple values,just create a internal table as follows.
    types : begin of ty,
            belnr....
            temp(12),
            end of ty.
    data itab_ type standard table of ty.
    data wa type ty.
    loop at itab into wa.
    concatenate '%' wa-belnr '%' into wa-temp.
    modify itab from wa index sy-tabix transporting temp.
    endloop.
    Change your select statement accordingly.
    Kindly reward poits if it helps.

  • How to write a cursor for mutiple columns in forms urgent required.........

    i created one table rk with 8 columns and that i designed in forms.
    but i have another table grk with 4 columns.
    this grk contains data.
    this grk 4 columns data i have to retrive in rk table in froms by multiple records.
    the both column names are same in the both tables.
    because by seeing this 4 columns data i will insert remaining 4 column by entering in rk table in form.
    i known that i have to write cursor to retrive the 4 columns data for multiple record from grk table and in trigger i have to produce to rk table.
    i have worked but it is not working.
    can any body help me out how to write a cursor for 4 column to retrive multple records in form

    Hi,
    Try,
    DECLARE
            CURSOR Cur_Test IS SELECT <field_1>, <field_2>, <field_3>, ... <field_n> FROM <table_name> WHERE <condition>;
    BEGIN
            OPEN Cur_Test;
            LOOP
                    FETCH Cur_Test INTO <items_or_variables>;
                    EXIT WHEN Cur_Test%NOTFOUND;
            END LOOP;
            CLOSE Cur_Test;
    END;Regards,
    Manu.

  • How to write  complex sql for this

    Hi ALL,
    I have a requirement like this
    I have 5 tables which i have to join to get the result
    but there no join column to 2 other table.
    I want to get all the applications using cobal,running on UNIX.
    How to write the query for this
    1.APP
    APP_i DESC
    1 Accounts
    2 Payments
    3 order transfer
    4 Order processing
    2.Techgy
    techid techdesc
    1 cobal
    2 Java
    3.APP_Techgy
    APP_I Techid
    1 1
    2 1
    3 1
    4 2
    4.Pltfrm
    pltfmid pltfrmdesc
    1 Windows NT
    2 UNIX
    5.APP_Pltfrm
    APP_I pltfrmid
    1 1
    2 1
    3 2
    4 2
    ouput must be
    APP_i Desc techDESC pltfrmdesc
    3 ordertranfer Cobal UNIX
    Thanks in advance

    This ('descr' in place of 'desc')?
    SQL> select a.app_i, a.descr, t.techdesc, p.pltfrmdesc
    from app_techgy atc,
       app a,
       techgy t,
       app_pltfrm ap,
       pltfrm p
    where atc.techid = t.techid
    and atc.app_i = a.app_i
    and atc.app_i = ap.app_i
    and ap.pltfrmid = p.pltfmid
    order by a.app_i
         APP_I DESCR                TECHDESC             PLTFRMDESC         
             1 accounts             cobal                windows nt         
             2 payments             cobal                windows nt         
             3 order transfer       cobal                unix               
             4 order processing     java                 unix               
    4 rows selected.

  • How to write sql query for counting pairs from below table??

    Below is my SQL table structure.
    user_id | Name | join_side | left_leg | right_leg | Parent_id
    100001 Tinku Left 100002 100003 0
    100002 Harish Left 100004 100005 100001
    100003 Gorav Right 100006 100007 100001
    100004 Prince Left 100008 NULL 100002
    100005 Ajay Right NULL NULL 100002
    100006 Simran Left NULL NULL 100003
    100007 Raman Right NULL NULL 100003
    100008 Vijay Left NULL NULL 100004
    It is a binary table structure.. Every user has to add two per id under him, one is left_leg and second is right_leg... Parent_id is under which user current user is added.. Hope you will be understand..
    I have to write sql query for counting pairs under id "100001". i know there will be important role of parent_id for counting pairs. * what is pair( suppose if any user contains  both left_leg and right_leg id, then it is called pair.)
    I know there are three pairs under id "100001" :-
    1.  100002 and 100003
    2.  100004 and 100005
    3.  100006 and 100007
        100008 will not be counted as pair because it does not have right leg..
     But i dont know how to write sql query for this... Any help will be appreciated... This is my college project... And tommorow is the last date of submission.... Hope anyone will help me...
    Suppose i have to count pair for id '100002'. Then there is only one pair under id '100002'. i.e 100004 and 100005

    Sounds like this to me
    DECLARE @ID int
    SET @ID = 100001--your passed value
    SELECT left_leg,right_leg
    FROM table
    WHERE (user_id = @ID
    OR parent_id = @ID)
    AND left_leg IS NOT NULL
    AND right_leg IS NOT NULL
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to find table information for a datasource?

    Hi,
    Can you please tell me how to find table information for a datasource. I am not getting much help from help.sap.
    I am trying to find table information for below datasources. We are creating DSO's for the below mentioned datasources, for some we have standard DSO's(0WBS_O06), for others I am trying to create
    0CO_OM_NWA_1,
    0CO_OM_NWA_2,
    0CO_OM_WBS_1,
    0CO_OM_WBS_6
    Please help me.
    Regards,
    Bob.

    Hi BOB,
    Another option to find the table information...
    inorder to get the tables names involved in that particular data source follow the below steps.
    1) ST05 --> activate the Trace
    2) RSA3 --> enter your data source (for ex: 0CO_OM_NWA_1)
    3) Execute
    4) Now goto ST05 -> deactivate the trace
    5) click on Display trace(F7) button
    6) Execute
    7) It will display the complete SQL trace
    8) Now from the Menu "Trace list" --> select "Combined Table Access"
    it will display the complete tables list involved in that data source...
    From Table name section you can get the list of tables involved in that data source.
    I had traced and took the information of tables involved in that data source 0CO_OM_NWA_1
    0CO_OM_NWA_1     
    AFKO     Order header data PP orders
    AFVC     Operation within an order
    AUFK     Order master data
    COSP     CO Object: Cost Totals for External Postings
    COSPP     Transfer of the Order in the COSP Table to the Project
    COSS     CO Object: Cost Totals for Internal Postings
    COSSP     Transfer of the Order COSS Table to the Project
    COVREF     Coverage Reference Table: All Processing Blocks
    COVRES     Table of Coverage Results
    You can follow the same steps and find the tables for the rest.
    Regards
    KP

  • How to write professional documentation for java

    Hi, I have few application I need to write documentation for. Im ok with the user and serwer technical stuff. But how to write proper documentation for source code? Any tutorial or howto?
    Best regards.

    Phenom7 wrote:
    Hi, I have few application I need to write documentation for. Im ok with the user and serwer technical stuff. But how to write proper documentation for source code? Any tutorial or howto?A pointer: be explicit and specific when writing Javadocs. If your method never returns null, make sure you say so. If it can't accept null as a parameter, be sure to say what the consequence will be if it happens (but it's OK to say the result is undefined!). A well-written method Javadoc will make users of any API you make a lot more happy, rather than keeping them guessing or making them inspect your source code.
    It's expected that while the implementation of a method will change, its pre and post-conditions will not. Therefore, having a good method-level Javadoc is critical to both the people counting on your code and the people maintaining your code.

  • How to write a PCR for this ?

    Hi SAP-HR Experts .
    Dear friends , My Company Requires a specific requiremnt that at the date of any Employee's
    B'day his one day salary should get doubled and he is entitled to get one leave on his B'day .
    I do not know how to write a PCR for this ?
    May some Body tell me how to meet this requirement Please .
    tell me please step by step how to go through ...
    It will be great help for me .
    Best regards : rajneeesh

    I think you can make it with something like this:
    Write a PCR in schema, you can call the rule with "actio";
    000860 ACTIO 9BIR AR               Birthday
    Rule 9BIR
    9BIR Rule for Birthday
            NUM=FG C   Set                   " F (fixed indicator for deadline calculation); G (Birth date from infotype 0002);C (complete months)
            NUM/12     División              " Number of completed months divided by  12
            NUMV0O2L   Off.Lng en arg.var.   " the last two places of the number are entered in the variable argument.
                                " if the rest is not 00, there is nothing to do
              00                             " if the rest is 00
                ZERO= N    AmtNumRteZeit = 0 "
                AMT=  1002 Set               " wagetype of  salary
                AMT/TKDIVI División          " divides the amount by  Partial Period Parameter Whole Month
                ADDWTI1002 Input table       " accumulates into 1002
    Example: an employee with birthday 01.01.1977 in IT0002
    Payrroll in january 08
    wagetype 1002 before rule 9BIR:
    3 1002 Salario Bas01                           30,33  30,00              909,90
    Rule 9BIR
    NUM=FG C   Set; NUM= 372
    NUM/12        ; 372/12= 31 rest=00
    AMT=1002      ; AMT= 909,90
    AMT/TKDIVI    ; 909,90/31= 29,35
    ADDWTI1002    ; 909,90 + 29,35= 939,25
    wagetype 1002 before rule 9BIR:
    3 1002 Salario Bas01                           30,33  30,00              939,25
    Hope this helps. Manuel

  • How to write a code for cumulative values..

    Hi
    Can any one proivde the Sudo code for Customer exit at Reports.
    I need to write a code for when ever user input Calaender month then querry calucalate the cumulative values also.
    How to write a code for cumulative values..
    Example:
    Customer -Sales.Quantity(CalMonth)---   Sales.quantity(Cumulative Month)  
    1000--223--
    2200
    Regards
    mannev.

    hi mannev,
    to get an idea, search in SDN
    for example
    customer exit code
    with hopes,
    Raja Singh

  • Can any one please tell me how to write labview program for data logging in electric motor bike.

    Can any one please tell me how to write labview program for data logging in electric motor bike. I am going to use CompactRIO for getting wide range of data from various sensors in bike. I need to write labview program for data logging of temperature, voltage and speed of the bike. Can any one help me?

    Yes, we can.   
    I think the best place for you to start for this is the NI Developer Zone.  I recommend beginning with these tutorials I found by searching on "data log rio".  There were more than just these few that might be relevant to your project but I'll leave that for you to decide.
    NI Compact RIO Setup and Services ->  http://zone.ni.com/devzone/cda/tut/p/id/11394
    Getting Started with CompactRIO - Logging Data to Disk  ->  http://zone.ni.com/devzone/cda/tut/p/id/11198
    Getting Started with CompactRIO - Performing Basic Control ->  http://zone.ni.com/devzone/cda/tut/p/id/11197
    These will probably give you links to more topics/tutorials/examples that can help you design and implement your target system.
    Jason
    Wire Warrior
    Behold the power of LabVIEW as my army of Roomba minions streaks across the floor!

  • How to write Error message for select options?

    Hi
    i have this select option statement
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    how to write error message for this?
    Regards
    Smitha

    Error messages are displayed for Select-options mostly on two conditions:
    1) You needs to check wether a value is entered or not its done by:
    a)
    Select-options:SELECT-OPTIONS: s_fevor FOR afko-fevor Obligatory.
       In this case error message is automatically throwed by system.
    b) You can do this in Selection Screen events.
    Ex:
    AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
    IF S_FEVOR-LOW IS INITIAL.
    MESSAGE 'XXXXX' TYPE 'E'.
    ENDIF.
    2) You need to Validate the entered value:
    You can do this in Selection Screen events.
    Ex:
    AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
    SELECT FEVOR
                 FROM AFKO
                 INTO AFKO-FEVOR
                 UP TO 1 ROWS
    ENDSELECT.        
    IF SY-SUBRC NE 0.
    MESSAGE 'XXXXX' TYPE 'E'.
    ENDIF.
    Regards,
    Gurpreet

Maybe you are looking for

  • MD04 - Stock Requirement List

    Hi Experts, Please tell me following: In which table I will find link of dependent requirement & planned order. I have run MRP for FG material ( MMR - 20000050) . I got planned order no 10001 for FG material. Then I saw MD04 for ROH material ( MMR -

  • Thumbnail view for Library copied from Asset Library does not work

    Hello , I created list definition based on Assed Library (I copied files from \15\TEMPLATE\FEATURES\AssetLibrary\AssetLibrary ) - I reused schema.xml and other files. Then I added my new custom content type. The problem is following:  thumbnail view

  • Could anyone help me analyze this dump file?Thanks!

    ===== BEGIN DUMP ============================================================= JRockit dump produced after 0 days, 22:13:58 on Sat Oct 9 16:54:30 2010 * If you see this dump, please go to * * http://edocs.bea.com/jrockit/go2troubleshooting.html * * f

  • SQLException Handling

    I am writing a program which wants to capture the unique constraint violation error when an insertion is performed. I think I can do so by checking the value of the exception.getErrorCode() when an SQLException. However, how do I know which value to

  • Mpeg-2 at 320

    Use compressor to save mpeg-2 file at size 320x. I am not able to get custom size on mpeg-2. Client want video save as mpeg-2 and size 320. How?