How to insert abap code in LSMW generated program?

hi,
i m working on LSMW for loading data in SAP
i would like to insert abap code into the generated program....
it's because i have 1 BKPF segment (header data), 2 BSEG segments, but i cannot define rules by customizing for the second BSEG segment(LSMW doesn't permitt).
i already tried to insert code directly into the program, but obviously it disapears at each time i generate the program.
i saw that apparently a code insertion has already be made into this program and the subject of this insertion is to define rules for the second BSEG (exactly what i want to do....) and this modification doesn't disapear at new prog generation.....
Any idea ?

Hi
Why dont you use the FORM provided by LSMW
To use this please do the following
1.Goto option <b>Maintain Field Mapping and Conversion Rules</b>
2.Goto menu <b>EXTRAS->LAYOUT->Form Routines</b>
  Here you will now get many options like
   Global Data
   Begin of Transaction
Begin of Processing
Begin of Record
  like wise the End of these also.
Please put a breakpoint and check where you want to insert your code.
Note:
This is only for the Conversion Program and does not affect the main program used to update the Standard Tables
Hi , I was reading your earlier post .. It seems that you have worked on EMIGALL. Consider a similar situation, it is like writing the code in the events till CALL01...
Thanks
DOminic
Message was edited by: Dominic  Pappaly

Similar Messages

  • How to find function code for Dynamic generated program

    Hi,
    I have created a dynamic program for getting different selection screens depending on inputs . I am finding a flaw that, pressing 'BACK' buttn is leading some other action which was coded by me,  instead of going back.
    SY-UCOMM is also not working as it is dynamic program.
    Help me for getting previous screen.
    Please suggest me the inputs.Thank u
    Regards
    Aditya

    Hi Klaus,
    As per ur instructions, I replaced SY-UCOMM with SSCRFIELDS.
    But no change in my problem.
    The following screen shot is a program which is coded dynamically using fieldsymbols.
    When I press BACK here for the following code selectionscreen, I am getting someother action which was coded by me. But not going back.
    Twist is, SSCRFIELDS-UCOMM or SY-UCOMM is getting captured for 'F8', but not 'BACK'.
    I hope, I have explained my issue clearly. Please let me know, if any deep clarifications needed.
    Regards,
    Aditya

  • ABAP code to automatic generate an BW Report

    HI Sap BW gurus,
    Can anyone tell me if exists an abap code to automatic generate an report from a query and save it on an directory in HTML format?
    Thanks in advanced,
    Pedro Martins

    You can use this tool...
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
    but then you would have to store it into an application server directory as HTML - there is also a how to paper by the same author which you can use... which talks about email query results in HTML
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b7658119-0a01-0010-39a9-b600c816f370;jsessionid=%28J2EE3414800%29ID1001478750DB10940138154678751341End

  • How find the ABAP code with Error message

    Hi
    How to  find the ABAP Code for Error Message?
    Example:
    Error Message: ZF026.
    Regards
    Odaiah Pelley
    Edited by: Odaiah Pelley on Aug 22, 2008 4:21 AM

    Hi
    Excellent Answer, I appreciate it.
    My question is with Error Message ZF026.
    How to find ABAP Code ?
    If I go for SE91 I will get same message as if I am getting error message.It is no use.
    Regards
    Odaiah Pelleyu

  • To execute from ABAP code an external Unix program

    HI,
    I would like to know how to execute from ABAP code an external Unix program and check for a return code?

    HI,
    There are different ways to this:
    (1) OPEN DATASET <file> FOR OUTPUT 'unix command'
    CLOSE DATASET <file>
    This command executes the unix command and writes the output into <file>
    Look into OSS Note 9391.
    (2) or try the following program but unfortunately the command CALL SYSTEM is
    not supported by SAP. If you are on R/3 2.1 - 2.2x you can get some idea's from the program SAPMSOS0.
    REPORT ZUNIXCOM .
    DATA: U_COMMAND(200).
    Table for system messages
    DATA: BEGIN OF RT OCCURS 100 ,
    LINE(100) ,
    END OF RT .
    START-OF-SELECTION .
    MOVE 'unix command' to U_COMMAND .
    REFRESH RT.
    CALL 'SYSTEM' ID 'COMMAND' FIELD U_COMMAND
    ID 'TAB' FIELD RT-SYS .
    LOOP AT RT.
    WRITE : / RT-LINE .
    ENDLOOP. 
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • Problem with abap code in lsmw.its urgent

    Hello guys iam migrating open ar line items using lsmwand i need to create reconciliation key automatically so iam using below code which is working fine in abap editor but i inserted in the lsmw abap code block at step 5 mapping fields iam getting error as that function module does not exits .can any body go through the code and give me suggestion.your will be greatly appreciate.
    types: begin of ty_fikey,
           fikey type fikey_kk,
           resob type resob_kk,
           end of ty_fikey.
    data: wa_fikey type ty_fikey.
    CALL FUNCTION 'FKK_FIKEY_CHECK'
      EXPORTING
        I_FIKEY                      = 'jana56481'
      I_OPEN_ON_REQUEST            =
      I_OPEN_WITHOUT_DIALOG        =
      I_FOR_MASS_POSTING           =
       I_RESOB                      = '24 '
      I_RESKY                      = ' '
      I_NON_EXISTING_ALLOWED       = ' '
      I_FOR_POSTING_IN_UPD         = ' '
    EXCEPTIONS
      NON_EXISTING                 = 1
      OTHERS                       = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    select single  fikey resob from dfkksumc into corresponding fields of wa_fikey where resob = '24'.
    e1bpdfkkko-fikey = wa_fikey-fikey.
    Regards
    Janapathi

    Hi,
    Refer link:
    <a href="http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc">http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc</a>
    Pls do reward points.
    Regards,
    Ameet

  • How to debugg abap code

    hello expert,
    how to debugg abap code

    Hi,
    If you want debug the Start,End and Expert routine set your break point in code where you want debug. using below option.
    1. Open you code then go to Extras Menu -> Select Displau Generated Programme
    2. Go to DTP and select Serally in Dialog Process (for Debugging) and click on Execute button it will take you the debugg screen.
       there you can debug your code.
    if you want check field routine. once you active that code in that Transformation only you find the test option there you can check your code is working or not.
    Hope it will help you.
    Thanks and Regards,
    Venkat.

  • How To Create ABAP Code For HR Context Sensitive Structural Authorization

    Hello,
    We have created a HR Custom Program which IS NOT built off the PCH or PNP Logical Database. As a result, we need to manually create ABAP code for HR Context Sensitive Structural Authorization Check in our custom HR program. Via HR Context Sensitive Structural Authorizations, we are restricting access to personnel numbers and the underlying HRP* tables.
    Any assistance would be greatly appreciated with the identification of the SAP standard function modules (Ex. RH_STRU_AUTHORITY_CHECK, HR_CHECK_AUTHORITY_INFTY, HR_CHECK_AUTHORITY_INFTY , etc) used in HR Context Sensitive Structural Authorization Check, how they are used to control HR Structural authorization (P_ORGINCON), and some sample code.
    Thank you in advance for all your assistance,
    Ken Bowers

    Hello Ken
    You can use the interface methods IF_EX_HRPAD00AUTH_CHECK to get the same structural authorization as you can see in PA20/PA30. You need to use the methods set_org_assignment and check_authorization for this purpose. For more information you can refer to include FP50PE21 from line 237 onwards till 270.
    Regards
    Ranganath

  • How to write ABAP code behind, the OLAP navigation functions

    Hi SDN Community,
    We have created an artificial hierarchy within BEx, using order structure elements, or characteristic key figures as SAP calls them.
    Now, the only feature that dosent seem to be present within the OLAP, is to expand all hiearchy nodes.
    It allows you to expand one hierarchy node, but not all the structure element nodes.
    I have tried command sequencing by specifying the technical id's of the the structure elements found via RSRT2, but this dosen't work.
    I have seen that when the nodes are expanded, that there is indeed standard SAP ABAP code executing back in the datawarehouse.
    Hence, do you know
    - Where to make ABAP enhancements for OLAP functionality
    - How to execute this ABAP (will it be by using Web API and javascript enhancements)
    - Is this possible, or has it been done by anyone?
    Thank you.
    Simon

    Hi Thomas,
    I have been working with a brilliant ABAP'er, and together we
    implemented a solution in the START method, that makes use of the
    following methods and expands all the hierarchy nodes at start.
    And this class can be omitted in the Print all view we have formulated
    as only a collapsed view has been specified there.
    thank you.
    Simon
    I found this all in that class interface CL_RSR_REQUEST
    for N_R_REQUEST
    for N_R_DATA_SET
    Initial Value: Set Drilldown State of a Hierarchy
    Description: 'SET_DRILL_STATE'
    this looks like the method that gets executed. what do you think?
    can you code this in the program
    constants C_CMD_SET_DRILL_STATE type RSRCMDID
    value 'SET_DRILL_STATE'. "#EC NOTEXT
    methods SET_DRILL_STATE
    importing
    value(I_AXIS) type RRXAXIS optional
    value(I_POSITION) type I optional
    value(I_FOCUS_IOBJNM) type RSIOBJNM optional
    value(I_DRILLSTATE) type RRXDRILLSTATE optional
    value(I_TOGGLE) type RS_BOOL default RS_C_FALSE
    !I_R_PARAMETER type ref to CL_RSR_PARAMETER optional
    exporting
    !E_KEEP_LAST_LINES type I
    !E_KEEP_FIRST_LINES type I
    !E_NEW_LINES_FROM type I
    !E_NEW_LINES_TO type I
    !E_NODE_POSITION_FROM type I
    !E_NODE_POSITION_TO type I
    exceptions
    NO_PROCESSING
    X_MESSAGE .

  • How to insert a code for a function module into a Customer Exit Variable?

    I have two Key Figures viz., Net Prchs Rtl, and Net Prchs Unt. Both these Key figures have This Week (TW) and Last Week (LW). There is a variable for This week but there is no variable defined for Last week.
    I need to get data in the column LW (Last Week) for both the key figures.
    In function module EXIT_SAPLRRS0_001 one of the functions I have is:
    Get the previous Fiscal Week
              CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
    I need to create a new variable to get values in the Last week column for different key figures and use function “'DATE_TO_PERIOD_CONVERT'” in that variable.
    Can anyone please explain me the steps as to how to use a function module in a variable so that when the variable is used in a key figure it shows the output.
    In other words what I want to know is after creating a Customer exit variable of type Characteristic value how do I refer the above mentioned function moduel and insert the code for the function module into the Customer exit variable that I created.
    Thank you.
    TR.

    Hi Wond,
    Thanks a lot for your reply. I understand what you mean but I have never done this before so can you please explain it in a detailed manner. I have the following code:
    Get the previous Fiscal Week
              CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
                EXPORTING
                  i_date         = ld_date
                  i_periv        = lc_periv
                IMPORTING
                  e_buper        = ln_poper
                  e_gjahr        = ln_bdatj
                EXCEPTIONS
                  input_false    = 1
                  t009_notfound  = 2
                  t009b_notfound = 3
                  OTHERS         = 4.
              IF sy-subrc <> 0.
                MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              ELSE.
                lc_poper = ln_poper.
                CONCATENATE ln_bdatj lc_poper+1(2) INTO wa_e_t_range-low.
                wa_e_t_range-sign = 'I'.
                wa_e_t_range-opt = 'EQ'.
                APPEND wa_e_t_range TO e_t_range.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
    I believe I should now use the above code in my customer exit variable. If that's right can you please explain me the steps as to how should I do this so that the variable gets populated.
    Thank you.
    Regards,
    TR.

  • How To debug ABAP code using sapui5 application on NWBC

    Hi All
    I am working on NWBC with SAP_PAO_HRPROFESSIONAL_3 Role. This role contains SAPUI5 application. I am trying debug the ABAP code called while executing this application.
    Please help me how to get into ABAP debugger while executing this application.
    Thank you
    Ujj

    HI Ujj,
    First thing to do is look at the role and see which UI5 application is being executed. The UI5 application will be running in the web container of NWBC, you can make it open in a standalone browser (hold down the CTRL key in NWBC and go to the Help Menu) and then turn on the debugging tools (F12) in the browser. There you will see which Gateway services are being called. You will need to set your ABAP breakpoint in the implementation of the Gateway services. Find the class in SE80.
    Hth,
    Simon

  • ABAP Code example using "GENERATE DYNPRO"

    I am looking for ABAP code example who use the "Generate dynpro" dynamic generation of dynpro at runtime under SAP 4.6C version.
    Best regards,

    We have some programs that do:
    form %view.
    data: anz type i,
          prog like sy-repid.
      prog = sy-repid.
      perform init_download(rsaqexce).
      case %tab.
      when 'G00'.
        perform generate_view_dynpro(rsaqexce)
                using prog text-grl.
        describe table %g00 lines anz.
        tview100-lines = anz.
        perform init_view(rsaqexce) tables %g00 using tview100.
        call screen 100.
        perform reset_view_dynpro(rsaqexce).
      when others.
        message s860(aq).
      endcase.
    endform.
    I think they were copied from existing SAP programs. In any event, look at the relevant forms in program rsaqexce.
    And as Rich noted, SAP doesn't recommend this.
    Rob

  • How to compare ABAP Code?

    Hi All,
    I have 2 ABAP programs. How could I compare these 2 programs to see differences?
    Thanks,
    Kishan

    Hi,
    You can compare 2 Programs,
    Go to SE39 Transaction code and give the program names and click the Display, then it will shows 2 reports, then you can find out the Differences.
    if you want to compare Programs in  2 Different systems use the RFC..
    <u><b>1)</b></u> Start SE39
    <u><b>2)</b></u> Choose Compare different systems
    <u><b>3)</b></u> Enter both program names and the RFC destination of
       the remote program
    <u><b>4)</b></u> Choose Display
    the system show the differences in blue colour
    for more information -->
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/840ad679-0601-0010-cd8e-9989fd650822
    search Compare in this link, you will get more information
    Hope you got what you want
    Regards
    Sudheer

  • How to run ABAP code as a daemon process?

    Background:
    I need a daemon process to check status and react on it. This daemon may run for a long time.
    Current:
    to implement this, use an update module, to call a normal module with an endless loop (the loop may end dependent on some condition). While the message Update Terminate was got.
    Question:
    1. is the current way feasible? if it's OK, what might be the cause of the above problem?
    2. if the current way is not OK. what's the way to run ABAP code as a daemon process?
    Thanks and kind regards,
    Said
    p.s.
    Also please refer to the link below for more information:
    can update module call normal module?

    You could use InDesign Server, that can be run as a service. Have a look at its documentation for more details.
    -Manan

  • How to write abap code to create manual hierarchy

    Hi,
    This is urgent got to write abap code to create manual hierarchy.
    Thanks

    Hi Adam
    Thanks for replying.
    In my scenario i have one custom zinfoobject which have lots of attributes.
    So, i have to create hierarchy for this zinfoobject with three nodes. one node/charateristic is present in this zinfoobject as attribute. which will be the first node of hierarchy.
    Then second custom infoobject is external not present in attribute list. which will be the second node of hierarchy.
    Third node will be for which i am creating hierarchy.
    So basically need solution for this first.
    some one will load hierarchy info in some table and then will create view on top of that then i have to create datasource on top of that and write a program to load the data from that view in this hierarchy.
    Need solution for this abap program also.
    Thanks
    SAPBW

Maybe you are looking for