User exit code

Hi,
I add stat1 field come from PA0000 into the 0employee_attr, when run the rsa3, that filed is empty,
i used this code,
When '0Employee_attr'.
  REFRESH i_t_data.
break-point.
    loop at i_t_data INTO l_s_HRMS_BIW_IO_OCCUPANCY.
      l_tabix = sy-tabix.
     Select single stat1 from PA0000 into PA0000-stat1
      Select single stat1 from PA0000 into l_s_HRMS_BIW_IO_OCCUPANCY-ZZSTAT1
      Where PERNR = l_s_HRMS_BIW_IO_OCCUPANCY-PERNR.
      if sy-subrc = 0.
        l_s_HRMS_BIW_IO_OCCUPANCY-ZZSTAT1 = PA0000-stat1.
        Modify i_t_data from l_s_HRMS_BIW_IO_OCCUPANCY INDEX l_tabix.
       Clear l_s_HRMS_BIW_IO_OCCUPANCY-ZZSTAT1.
      Endif.
    Endloop.
Please help me to fix this problem.
Thanks

DS name needs to be in upper case.
when you do a select into, you don't need a second assignment.
try the below code.
When '0EMPLOYEE_ATTR'.
REFRESH i_t_data.
break-point.
loop at i_t_data INTO l_s_HRMS_BIW_IO_OCCUPANCY.
l_tabix = sy-tabix.
Select single stat1 from PA0000 into PA0000-stat1
Select single stat1 from PA0000 into l_s_HRMS_BIW_IO_OCCUPANCY-ZZSTAT1
Where PERNR = l_s_HRMS_BIW_IO_OCCUPANCY-PERNR.
*if sy-subrc = 0.
*l_s_HRMS_BIW_IO_OCCUPANCY-ZZSTAT1 = PA0000-stat1.
Modify i_t_data from l_s_HRMS_BIW_IO_OCCUPANCY INDEX l_tabix.
Clear l_s_HRMS_BIW_IO_OCCUPANCY-ZZSTAT1.
*Endif.
Endloop

Similar Messages

  • BW User Exit - Code in function of the query name

    Hi,
    I would like to create an user exit code which execute a algorithm different in function of the query executed. do you know in which variable is store the technical name of the query.
    CASE query
        WHEN 'Z_ZAPO_001'.
           V1 = 1
        WHEN 'Z_ZAPO_002'.
          V1 = 2    WHEN '10' OR '11' OR '12'.
    ENDCASE.

    Yaroslav,
    I_S_RKB1D-COMPID will never be filled for authorization user-exits (I_STEP = 0). Don't ask my why, I once raised this question to OSS and they replied it was never foreseen to work with authorization user-exits. God knows why, it's very unlogical and it wouldn't cost them a lot of work to get it working...
    I could solve this problem by applying a little trick. In our queries we included a user-exit keydate variable. This will push the user-exit first in I_STEP = 1 mode where I_S_RKB1D-COMPID is filled. Then save the query name by exporting it to the ABAP-memory. Afterwards, the user exit with code for I_STEP = 0 will be processed and then you can import the query name from the ABAP memory.
    I agree it sounds a little bit tricky but there is no better option I'm affraid.

  • User exit code does not execute

    I'm having a problem with User exit code that does not execute yet seems to be set up correctly.
    The User exit is implemented as FM "EXIT_SAPLIPW1_001" in function group XQSM.
    I've tried everything I know of with the CMOD and SMOD transactions, and I suspect some sort of transport error.
    The only clue I can find in comparing the development system (which works) with the test system (which does not work) is that running "Extended Check" in SE80 on function group XQSM fails with the following error:
    "The namespace of program SAPLXQSM has the setting "C" and cannot be tested."
    Has anyone any idea what could have happened?

    Let us try to retrace the steps.
    1. You created a Z project in CMOD and assigned the enhancement IQSM0001 and the component EXIT_SAPLIPW1_001 and activated the same. This is there in the transport.
    2. You double clicked on the include in the user exit and created it. You activated the code and included it in the same transport.
    If you did the above steps, then your user exit should be active in your test system.
    Can you please go to SE10, and list out the objects in your transport? You should see entries in there like below(not necessarily a complete list)
    R3TR CMOD <your project name>
    R3TR PROG ZXQSMU01
    See if you created any of the objects as local objects.
    Srinivas

  • 0FI_AR_4 Extractor Enhancement without user exit code Question

    Hi
    I have a requirement to enhance 0FI_AR_4 Extractor with below Fields from BSID:
    Field     DataElement
    PRCTR       PRCTR
    VPOS2       NUM06
    VBUND       RASSC
    As per SAP Note: 410799, I am assuming I don't need to write any ABAP code to populate these fields.
    In the extract structure DTFIAR_3 of extractor 0FI_AR_4 Double clicked on the Include CI_BSID.
    It prompted "Structure CI_BSID not available. Create the structure?"
    After entering Access key it created new Structure "CI_BSID".
    I have entered the Component and Component Type values as below:
    Component   Component Type
    YYPRCTR     PRCTR
    YYVPOS2     NUM06
    YYVBUND     RASSC
    1. Please let me know Component and Component Type values and the steps I followed are correct or not?
    2. And I hope I don't need to write the code in the User exit to populate these fields?
    Thanks
    Sree

    Hi,
    For any FI datasource enhancement there are two scenarios :-
    1. All the fields of the customer enhancement in the customer include are available in the read structure BSID
    Then no additional action is required. The fields of the customer enhancement are filled automatically by the datasource from the assigned read structure via "move-corresponding".
    2. Fields of the customer enhancement in the customer include are not contained in the read structure BSID
    In this case you have to program a function module to fill the field of the customer enhancement. To do this, there is a Business Transaction Event available (open FI interface for process 00005021). Create any function module you like and use function module SAMPLE_PROCESS_00005021 as a template for the interface (input parameter, changing parameter).
    Hope this helps.
    Reg,
    Rahul

  • EDI - IDoc - User Exit - Code - Problem - Help - Wanted

    Hi EDI Experts,
    I have extended ORDERS05 IDOC twice.
    ZVKSEG1 is the the segment under extended idoc ZVKORDRS05. This is for one partner.
    Z1DATESH01 is the segment under extended idoc Z1ORDER05. This is for another partner.
    I have completed the configuration thing in WE82 for both the extensions.
    Now the requirement is, whenever a PO is created for the first partner - 100290, the IDoc generated should contain the extra segment ZVKSEG1 and whenever PO is created for the second partner - 10099,the Idoc generated should contain the extrasegment Z1DATESH01.
    Using WE20, i have added the extended IDoc type in both the partner profiles under ORDERS message type.
    Now i've written the user exit for this using EXIT_SAPLEINM_002.
    tables: edidc.
    data: z_edidd like edidd occurs 0 with header line.
    data: y1dath01 like z1datesh01.
    data: yvkseg1 like zvkseg1.
    if edidc-rcvprn = '10099'.
    z_edidd[] = int_edidd[].
    loop at z_edidd.
    if z_edidd-segnam  = 'E1EDK01'.
    read table z_edidd  with key segnam  = 'Z1DATESH01'.
    if sy-subrc <> 0.
    y1dath01-DELDATE = sy-datum.
    clear z_edidd.
    z_Edidd-sdata = y1dath01.
    z_Edidd-segnam = 'Z1DATESH01'.
    append z_edidd.
    endif.
    endif.
    endloop.
    int_edidd[] = z_edidd[].
    elseif edidc-rcvprn = '100290'.
    z_edidd[] = int_edidd[].
    loop at z_edidd.
    if z_edidd-segnam  = 'E1EDK01'.
    read table z_edidd  with key segnam  = 'ZVKSEG1'.
    if sy-subrc <> 0.
    yvkseg1-name1 = 'ZVK Chemicals'.
    clear z_edidd.
    z_Edidd-sdata = yvkseg1.
    z_Edidd-segnam = 'ZVKSEG1'.
    append z_edidd.
    endif.
    endif.
    endloop.
    int_edidd[] = z_edidd[].
    endif.
    Could you please go through the code and tell me where did i go wrong. The extra segments are not being created for both the partners.
    I created PO using ME21n once for each vendor.
    Please help me out guys.
    Thanks,
    Matt

    I myself fixed this problem. I made use of XLFA1-LIFNR to manipulate the partner numbers.
    Thanks

  • Excluding idoc processing from user exit code

    Hi all,
    In a user exit (for VA01 Create Sales Order) we are currently excluding certain order types by hardcoding the document type in the code. This is because some orders are created by IDoc and in this case the IDocs fail if they use the eser exit code (because the code creates pop-up messages intended for online users only). Not the best solution.
    Does anybody know if we can use different code so that this part of the user exit does not get triggered by IDocs?
    Thanks,
    Mike

    I've figured out another solution - you can do a test on the field IDOC_NUMBER. If it is filled, then the sales order is created/changed via an Idoc.

  • USER EXIT CODE In BEX

    Friends,
    In Bex query for an ODS,I need to create a report
    -In the selection screen user has to enter one date value.(DATE1 Varible)
    I need to get the values in the report based on following condition
    ==>DATE1 < DATE2.
    As user defined variable can be used in one charcteristics only,I unable to include Date1 variable in DATE2 Restriction Option.
    I will have to write the user exist for this?.If so pls help me with the user exist code.
    Thanks in advance.
    Soujanya

    Hi,
    Pls create a customer exit variable 'ZPDATE2' for DATE2(Clearing Date) with the code below and use it as apprpriate in the query together with DATE2.
    What the code does is to transfer the value of the variable 'ZPDATE' to the variable 'ZPDATE2' (upon user entry of 'ZPDATE')
    CASE I_VNAM.
      WHEN 'ZPDATE2'. " Characterstic VARIABLE
        IF I_STEP = 2.
    get variable value 'ZPDATE'
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                       WHERE VNAM = 'ZPDATE'. " Current fiscal Period.
            CLEAR : L_S_RANGE.
    *--- fill value ranges
            MOVE : 'I' TO L_S_RANGE-SIGN,
                   'LT' TO L_S_RANGE-OPT.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.    " for After pop-up
    ENDCASE.
    Hope this helps !

  • How to see user exit code

    hi,
    i have one user exit name with me like EXIT_SAPLVxxxxx. how can i see it's code.
    thks

    Those user exits are build as function modules. Just goe to transaction SE37, put in the name and there you go. Double click on the include in the FM and you'll see the code. If the include doesn't exist this user exit has not yet been implemented.
    Regards,
    Michael

  • User exit code -  help required

    Hi Experts,
    I need to write a user exit for the field Posting level in the query. The logic is ,when posting level is either 10 or 20 for an ITEM then Key figure "Period value GC" should be divided by two and the result shouls be stored in the same Key figure.
    Technical names of the fields are as follows:
    Posting Level - 0cs_plevel . We have created a user exit variable ZBSUSER.
    Item - 0ITEM
    Period Value GC - 0cs_per_gc.
    Please let me know  the code to be written in CMOD to achieve the above result.
    Thanks,
    Kavitha Jagannath

    Hi,
    I need to write a user exit for the field Posting level in the query. The logic is ,when posting level is either 10 or 20 for an ITEM then Key figure "Period value GC" should be divided by two and the result shouls be stored in the same Key figure.
    You can do it in report it self you don't need EXIT CODE.
    Steps:
    1. Create a RKF and restrict (Include)ITEM = 10 and 20 &  drag and dropn Period value GC   " RKF -1
    2. Create another RKF and EXCLUDE ITEM = 10 and 20 &  drag and dropn Period value GC.  " RKF -2
    3. In Columns display both and create Formula-1 and divide RKF-1 with 2.
    4. Create a Formula and add Formula-1 and RKF -2  
    5. Hide unwanted calculations
    Your problem is resloved.
    Thanks
    Reddy
    Edited by: Surendra Reddy on Dec 14, 2009 2:25 PM

  • User exit code required for manadatory variable

    we have vendor in rows  and sales in columns, the requirement is there is a mandatory  variable for retrieving the sales between months, that is if
    customer gives calmonth january as <b>from</b> and march as<b> to</b> the sales should be from Jan to March, if the customer only gives <b>from</b> month and nothing for<b> to</b> month, only <b>from</b> month should be calculated, if the customer gives only<b> to</b> month and no <b>from</b> month, the <b>to</b> month should be calculated. Remember the variable is mandatory.

    Hi,
    Let s say
    var1 is from varaible
    var2 is to variable
    var3 is user exit variable
    USe the code like this:
    DATA:
    l_s_range TYPE rsr_s_rangesid,
    l_s_var TYPE rrs0_s_var_range.
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
    DATA: LOC_VAR_RANGE2 LIKE RRRANGEEXIT.
    WHEN 'VAR3'.
        IF I_STEP = 2.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
            WHERE VNAM = 'VAR1'.
          LOOP AT I_T_VAR_RANGE2 INTO LOC_VAR_RANGE
            WHERE VNAM = 'VAR2'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(8).
            L_S_RANGE-HIGH = LOC_VAR_RANGE2-LOW(8).
    IF LOC_VAR_RANGE2(8) = '00000000'.
            L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW(8).
    ENDIF.
    IF LOC_VAR_RANGE(8) = '00000000'.
            L_S_RANGE-LOW = LOC_VAR_RANGE2-LOW(8).
    ENDIF.
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT  = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
          EXIT.
          ENDLOOP.
          EXIT.
          ENDLOOP.
        ENDIF.
    With rgds,
    Anil Kumar Sharma .P

  • Hierarchy BW User Exit code EXIT_SAPLRSAP_004 ZXRSAU04

    Hi All,
    We are loading Hierarchy data in BW using User Exit by taking data from master dat InfoObject.
    As we thought it's working fine; but on every 2nd load it's getting failed (1st load is success, 2nd load failed, 3rd load success likewise; so every alternate load is getting failed). We tried with all the options in Infopackage.
    As per our assumptions and the requirement we could able to load the data through user exit.
    We need your help in the following code where we are missing or we are missing some process in BW.
    We request you please give us suggestions ASAP.
    thanks in Advance.
    *&  Include           ZXRSAU04
    data:y_i_/BIC/PYIOSID type standard table of /BIC/PYIOSID,
         y_wa_/BIC/PYIOSID type /BIC/PYIOSID,
         lwa_upmode type char1.
    data:y_i_/BI0/HCRM_OBJ_ID type standard table of /BI0/HCRM_OBJ_ID,
         y_wa_/BI0/HCRM_OBJ_ID type /BI0/HCRM_OBJ_ID,
         y_wa_hienode type RSAP_S_HIENODE.
    data:y_I_table like standard table of C_T_HIENODE.
    data: y_v_active type char1.
    data:y_v_n(8) type n.
    *refresh C_T_HIENODE[].
    case I_DATASOURCE.
      when '80CRM_OBJ_IDH'.
    To load the data from YIOSID master data into 0CRM_OBJ_ID hierarchy
       delete  C_T_HIENODE where nodeid ne '00000001'.
        select single *
           from /BI0/HCRM_OBJ_ID
           into y_wa_/BI0/HCRM_OBJ_ID
           where nodeid = '00000002'.
        if sy-subrc eq 0.
         move:C_T_HIENODE[] to y_I_table[].
         refresh C_T_HIENODE.
         move  y_I_table[] to C_T_HIENODE[].
         refresh y_I_table[].
          CALL FUNCTION 'RSHIER_HIER_SUBTREE_DELETE'
            EXPORTING
              I_HIEID                   = y_wa_/BI0/HCRM_OBJ_ID-HIEID
              I_DEL_IOBJNM              = y_wa_/BI0/HCRM_OBJ_ID-IOBJNM
              I_DEL_NODENAME            = y_wa_/BI0/HCRM_OBJ_ID-nodename
      I_DEL_DATETO              =
           EXCEPTIONS
             FOREIGN_LOCK              = 1
             HIERARCHY_NOT_FOUND       = 2
             CANCELED                  = 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.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
           delete C_T_HIENODE where nodeid ge '00000002'.
            commit work and wait.
           wait up to 15 seconds.
            CALL FUNCTION 'RSHIER_HIER_CHECK_AND_ACTIVATE'
              EXPORTING
                I_HIEID        = y_wa_/BI0/HCRM_OBJ_ID-HIEID
              IMPORTING
                E_ACTIVE_STATE = y_v_active
              EXCEPTIONS
                CANCELED       = 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.
       wait up to 3 seconds.
            else.
             commit work and wait.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
            ENDIF.
          endif.
        endif.
        select *
                from /BIC/PYIOSID
                into table y_i_/BIC/PYIOSID.
        if sy-subrc eq 0.
          sort y_i_/BIC/PYIOSID by /BIC/YIOSID OBJVERS.
        endif.
        if y_i_/BIC/PYIOSID[] is not initial.
          move: '0HIER_NODE' to C_T_HIENODE-IOBJNM,
               'OPP_NUM' to C_T_HIENODE-NODENAME,
               '00000002' to C_T_HIENODE-NODEID,
               '02' TO C_T_HIENODE-TLEVEL,
               '00000001' to C_T_HIENODE-PARENTID,
               '00000001' to C_T_HIENODE-childid.
          append C_T_HIENODE.
       move:
             '0HIER_NODE' to c_t_foldert-IOBJNM,
              'OPP_NUM' to c_t_foldert-NODENAME,
              'E'       to c_t_foldert-langu,
              'OPP_NUM' to c_t_foldert-txtsh.
       append c_t_foldert.
          loop at y_i_/BIC/PYIOSID into y_wa_/BIC/PYIOSID.
            if y_wa_/BIC/PYIOSID-/BIC/YIOSID is not initial.
              if y_wa_/BIC/PYIOSID-/BIC/YIOSID gt 2.
                move: '0CRM_OBJ_ID' to C_T_HIENODE-IOBJNM,
                y_wa_/BIC/PYIOSID-/BIC/YIOOBJ to C_T_HIENODE-NODENAME,
                y_wa_/BIC/PYIOSID-/BIC/YIOSID to y_v_n,
                y_v_n to C_T_HIENODE-NODEID,
                y_wa_/BIC/PYIOSID-/BIC/YIOTLEV TO C_T_HIENODE-tlevel,
                y_wa_/BIC/PYIOSID-/BIC/YIOPLEV to y_v_n,
                y_v_n to C_T_HIENODE-PARENTID.
                append C_T_HIENODE.
              endif.
            endif.
          endloop.
        endif.
    endcase.
    *ROSHIENODE

    Hi!
    I had the same problem during this user exit run.
    When load failed a new dump DBIF_RSQL_INVALID_CURSOR appeared.
    My problem appeared because system was loosing cursor during a SELECT...ENDSELECT run.
    I made my SELECTs smaller and everything become fine.
    SDN gives some notes:
    SAP Note Number: 1124093 70SP17: Extraction terminates with DBIF_RSQL_INVALID_CURSOR
    SAP Note Number: 401847   DBIF_RSQL_INVALID_CURSOR during extraction
    SAP Note Number: 675 Unexpected abends in SELECT loops (COMMIT)
    Hope it helps.

  • Hi user exit code required

    hi all,
          i have one requirement i.e when ever we give tcode xd06 or xd02 if customerno is there it wont accept the same customer again if customer is not there it has to insert the customer into the table. i require code for this requirement i need to write this in include called ZXF04U01and function module name is EXIT_SAPMF02D_001.
    Write below custom code inside the user exit to capture CRSID information in reverse mapping input table ZW2CTREV_MAP to trigger reverse mapping.
    Declare a work area WA_ZW2CTREVMAP of type ZW2CTREV_MAP.
    Assign values from I_KNA1 to work area WA_ZW2CTREVMAP.
    MODIFY TABLE ZW2CTREV_MAP FROM WA_ZW2CTREVMAP.
    above i have shown procedure for code.  send me the actual code what i have to write in include to check customer and insert customer pls reply as early as possible.
    regards
    sagar

    Hi,
    Let s say
    var1 is from varaible
    var2 is to variable
    var3 is user exit variable
    USe the code like this:
    DATA:
    l_s_range TYPE rsr_s_rangesid,
    l_s_var TYPE rrs0_s_var_range.
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
    DATA: LOC_VAR_RANGE2 LIKE RRRANGEEXIT.
    WHEN 'VAR3'.
        IF I_STEP = 2.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
            WHERE VNAM = 'VAR1'.
          LOOP AT I_T_VAR_RANGE2 INTO LOC_VAR_RANGE
            WHERE VNAM = 'VAR2'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(8).
            L_S_RANGE-HIGH = LOC_VAR_RANGE2-LOW(8).
    IF LOC_VAR_RANGE2(8) = '00000000'.
            L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW(8).
    ENDIF.
    IF LOC_VAR_RANGE(8) = '00000000'.
            L_S_RANGE-LOW = LOC_VAR_RANGE2-LOW(8).
    ENDIF.
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT  = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
          EXIT.
          ENDLOOP.
          EXIT.
          ENDLOOP.
        ENDIF.
    With rgds,
    Anil Kumar Sharma .P

  • How to debugg remodeling user exit code?

    hi all,
       did any body debugg the User Exit for Remodelling a cube?
    Regards,
    Nagesh Ganisetti.

    Hi Nagesh,
    I have never used remodelling exit tool but just an small regular idea,as we are using IF_RSCNV_EXIT interface exit for remodelling if you keep 'break-<b>username</b>'  or 'break-point' in between your code ,when you started processing your remodelling I think that process will get stopped at that beak point.
    Regards,
       KK

  • Doesn't execute my user exit codes.

    Hello Experts,
    I have created user exit ZXF05U01 to validate Tax Number1 field and activated. (txn fk02)
    Then Execute the transaction CMOD.
    Created a project ZFIAPVEN
    In "Enhancement assignments" added SAPMF02K as enhancement.
    Saved it.
    Then in the initial screen of cmod I've activated the project.
    Doesn't execute 'MODULE EXIT_KREDITOR AT EXIT-COMMAND.' When I ran the txn fx02 in debug mode it.
    Regards
    Naz

    I think I took the wrong path to validate the New Zealand specific tax number. Is it possible to set some rules in PRST1_005 in table T005.
    If this is possible then please pass me the steps description.
    Thanks.
    Naz

  • SAP APO Master Data Creation - Location , User Exit code samples

    Hi,
    I have a requirement of sending same location data from different logical ERP System to the SAP SCM System using CIF(Core Interfaces).
    I need to add suffix in the master data for Location to the inbound processing of Location data in the SAP SCM system to differentiate between the two systems.
    I have got an information to use EXIT_/SAPAPO/SAPLCIF_LOC_001 BADI enhancement point for the same.
    Can anyone please help me out with the code snippets.
    Any help documentation link is appreciated.
    Best Regards
    Sid

    Hi,
    U can use the below code which we have used somewhere.....
    *& Report  ZSCREP_LOC_CREATE
    REPORT  ZSCREP_LOC_CREATE.
    tables : /sapapo/loc.
    data : begin of it_loc occurs 0,
           LOCNO(20),
           end of it_loc.
    data : FLAG, temp_loc(20).
    data : LOCATION_HEAD        like  BAPI10002LOC2      occurs 0 with header line,
           LOCATION_HEAD_X      like  BAPI10002LOC2X     occurs 0 with header line,
           LOCATION_VERSION     like  BAPI10002LOCVERS2  occurs 0 with header line,
           LOCATION_VERSION_X   like  BAPI10002LOCVERS2X occurs 0 with header line,
           LOCATION_TEXT        like  BAPI10002LOCTEXT2  occurs 0 with header line,
           LOCATION_TEXT_X      like  BAPI10002LOCTEXT2X occurs 0 with header line,
           LOCATION_ADDRESS     like  BAPI10002LOCADDR2  occurs 0 with header line,
           LOCATION_ADDRESS_X   like  BAPI10002LOCADDR2X occurs 0 with header line,
           LOCATION_MODEL       like  BAPI10002LOCMODEL2 occurs 0 with header line,
           SAVE_OPTIONS         like  BAPI10002SAVEOPTIONS,
            RETURN              like  BAPIRET2 occurs 0 with header line,
           RETURN1              like  BAPIRET2 occurs 0 with header line,
           BAPI_RETN_INFO  LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    start-of-selection.
      select locno into table it_loc
      from /sapapo/loc
      where attlo05 <> 'X'
      AND LOCTYPE = '1011'
      AND LOCNO = 'T0001'.
      if sy-subrc = 0.
        loop at it_loc.
    For Material Type goto ECC thru RFC
          CALL FUNCTION  'ZRFC_SCM_VENDOR' DESTINATION  'LOGSYS250'  "CF_LOGSYS " Dynamic Logical System selection
            EXPORTING
              LIFNR =  it_loc-LOCNO
            IMPORTING
              FLAG = FLAG.
          IF FLAG =  'X'.
       Fill Header Data*************
            concatenate  'SUBCON_7001_' it_loc-LOCNO into  temp_loc.
           temp_loc = 'LAV12345'.
           it_loc-LOCNO = 'SHAH'.
            LOCATION_HEAD-LOCATION   =  temp_loc.
            LOCATION_HEAD-LOCTYPE    = '1050'.
            LOCATION_HEAD-TIME_ZONE  = 'INDIA'.
           LOCATION_HEAD-LOCATION_INT = it_loc-LOCNO.
           LOCATION_HEAD-SUBCONTRACTOR_PLANT     = '7001'.
            LOCATION_HEAD-SUBCONTRACTOR_PLANT_BSG = '7001'.
           LOCATION_HEAD-SUBCONTRACTOR_SUPPLIER = it_loc-LOCNO.
            LOCATION_HEAD-SUBCONTRACTOR_SUPPLIER_BSG =  it_loc-LOCNO.
           LOCATION_HEAD-DELIVERY_PRIORITY = '00'.
    append LOCATION_HEAD.
            LOCATION_HEAD_X-LOCATION = temp_loc.
            LOCATION_HEAD_X-LOCTYPE = '1050'.
            LOCATION_HEAD_X-LOCATION_INT = it_loc-LOCNO.
           LOCATION_HEAD_X-GLOBAL_LOCATION_NUMBER = 'X'.
           LOCATION_HEAD_X-LOCATION_DUNS = 'X'.
           LOCATION_HEAD_X-LONGITUDE = 'X'.
            LOCATION_HEAD_X-TIME_ZONE = 'X'.
            LOCATION_HEAD_X-SUBCONTRACTOR_PLANT = 'X'.
            LOCATION_HEAD_X-SUBCONTRACTOR_PLANT_BSG = 'X'.
            LOCATION_HEAD_X-SUBCONTRACTOR_SUPPLIER = 'X'.
            LOCATION_HEAD_X-SUBCONTRACTOR_SUPPLIER_BSG = 'X'.
    append  LOCATION_HEAD_X.
            LOCATION_VERSION-LOCATION = temp_loc.
            LOCATION_VERSION-LOCTYPE = '1050'.
            LOCATION_VERSION-PLANNING_VERSION = '000'.
    append  LOCATION_VERSION.
            LOCATION_VERSION_X-LOCATION = temp_loc.
            LOCATION_VERSION_X-LOCTYPE = '1050'.
            LOCATION_VERSION_X-PLANNING_VERSION = '000'.
    append  LOCATION_VERSION_X.
            LOCATION_TEXT-LOCATION = temp_loc.
            LOCATION_TEXT-LOCTYPE = '1050'.
            LOCATION_TEXT-LANGU = 'EN'.
            LOCATION_TEXT-LOC_DESCR = 'CreatE'.
    append  LOCATION_TEXT.
            LOCATION_TEXT_X-LOCATION = temp_loc.
            LOCATION_TEXT_X-LOCTYPE = '1050'.
            LOCATION_TEXT_X-LANGU = 'EN'.
      append  LOCATION_TEXT_X.
            LOCATION_ADDRESS-LOCATION = temp_loc.
            LOCATION_ADDRESS-LOCTYPE = '1050'.
           LOCATION_ADDRESS-TITLE =  'Mr.'.
           LOCATION_ADDRESS-NAME =   'TATA MOTORS'.
           LOCATION_ADDRESS-NAME_2 = 'PIMPRI'.
           LOCATION_ADDRESS-NAME_3 = 'SINGUR'.
           LOCATION_ADDRESS-CITY = 'PUNE'.
           LOCATION_ADDRESS-DISTRICT = 'PUNE'.
           LOCATION_ADDRESS-CHCKSTATUS = 'X'.
           LOCATION_ADDRESS-POSTL_COD1 = '411001'.
            LOCATION_ADDRESS-COUNTRY  =   'IN'.
            LOCATION_ADDRESS-LANGU    =   'EN'.
           LOCATION_ADDRESS-REGION  =   '25'.
            LOCATION_ADDRESS-TIME_ZONE  =   'INDIA'.
      append  LOCATION_ADDRESS.
            LOCATION_ADDRESS_X-LOCATION = temp_loc.
            LOCATION_ADDRESS_X-LOCTYPE = '1050'.
           LOCATION_ADDRESS_X-TITLE =  'X'.
           LOCATION_ADDRESS_X-NAME =   'X'.
           LOCATION_ADDRESS_X-NAME_2 = 'X'.
           LOCATION_ADDRESS_X-NAME_3 = 'X'.
           LOCATION_ADDRESS_X-CITY =   'X'.
           LOCATION_ADDRESS_X-DISTRICT = 'X'.
           LOCATION_ADDRESS_X-CHCKSTATUS = 'X'.
           LOCATION_ADDRESS_X-POSTL_COD1 = 'X'.
            LOCATION_ADDRESS_X-COUNTRY  =   'X'.
           LOCATION_ADDRESS_X-LANGU    =   'X'.
           LOCATION_ADDRESS_X-REGION  =   'X'.
            LOCATION_ADDRESS_X-TIME_ZONE  =   'X'.
    append  LOCATION_ADDRESS_X.
            LOCATION_MODEL-LOCATION = temp_loc.
            LOCATION_MODEL-LOCTYPE = '1050'.
            LOCATION_MODEL-MODEL = '000'.
      append  LOCATION_MODEL.
    SAVE_OPTIONS-NO_GEOCODING_FLAG      =  '0'.
            CALL FUNCTION 'BAPI_LOCSRVAPS_SAVEMULTI2'
              EXPORTING
                LOGICAL_SYSTEM               = 'DCMCLNT250'
                SAVE_OPTIONS                 = SAVE_OPTIONS
               COMMIT_CONTROL               = 'X'
               BUSINESS_SYSTEM_GROUP        =     'BSG1'
    TABLES
       LOCATION_HEAD                =   LOCATION_HEAD
       LOCATION_HEAD_X              =   LOCATION_HEAD_X
      LOCATION_MAPPING             =
      LOCATION_MAPPING_X           =
      LOCATION_SUBLOCATION         =
      LOCATION_SUBLOCATION_X       =
       LOCATION_VERSION             =   LOCATION_VERSION
       LOCATION_VERSION_X           =   LOCATION_VERSION_X
       LOCATION_TEXT                =   LOCATION_TEXT
       LOCATION_TEXT_X              =   LOCATION_TEXT_X
       LOCATION_ADDRESS             =   LOCATION_ADDRESS
       LOCATION_ADDRESS_X           =   LOCATION_ADDRESS_X
      LOCATION_SMTP                =
      LOCATION_SMTP_X              =
      LOCATION_TEL                 =
      LOCATION_TEL_X               =
      LOCATION_FAX                 =
      LOCATION_FAX_X               =
      LOCATION_URI                 =
      LOCATION_URI_X               =
       LOCATION_MODEL               =   LOCATION_MODEL.
        RETURN                       = RETURN
      EXTENSION_IN                 =
      LOCATION_SPP                 =
      LOCATION_SPP_X               =
            if sy-subrc = 0.
            LOOP AT RETURN.
            IF NOT RETURN IS INITIAL.
              CLEAR BAPI_RETN_INFO.
              MOVE-CORRESPONDING RETURN TO BAPI_RETN_INFO.      "#EC ENHOK
              IF RETURN-TYPE = 'A' OR RETURN-TYPE = 'E'.
               ERROR_FLAG = 'X'.
              ENDIF.
              APPEND BAPI_RETN_INFO.
            ENDIF.
          ENDLOOP.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                EXPORTING
                  WAIT = 'X'
    IMPORTING
       RETURN        =  RETURN1
             IF SY-SUBRC = 0.
             WRITE : 'KK'.
             ENDIF.
             if sy-subrc = 0.
               update /sapapo/loc
               set attlo05 = 'X'
               where  LOCNO = it_loc-LOCNO.
             endif.
            endif.
          endif.
        endloop.
      endif.

Maybe you are looking for

  • SL and Lion too much time to sleep!

    Hi, my mac is taking too much time to sleep, even with the change from SL to Lion... it always takes like 45sec with google chrome on and 25sec +- with it off... this are the pmset -g log that have the biggest time, I'm running latest google chrome d

  • Stop using the deposit function - change default G/L account

    We originally configured our system to use a separate clearing account and the deposit function for cash, credit card, and check incoming payment types.  Now, we would like to change that and post payments directly into our cash account without havin

  • ORA-00312 problem, thank you very much!

    Hi, there, when I use OEM standalone to login the database, I found there is an error: ORA-00313:open failed for members of log group1 of thred 1 ORA-00312:online log 1 thread 1 "c:\oracle-database-server\oradata\redo01.log" then I can't open the dat

  • Why does my iPod freeze when I plug it in?

    Everytime I plug my iPod classic into my computer, it freezes. It turns on, so it knows something has happened, but it freezes and doesn't get recognised by the computer, and the charging symbol doesn't appear on the battery. Then I unplug it, reset

  • Does apple tv work with iphone 4

    Does the new Apple TV airplay work with the Iphone 4 or does it only work with Iphone 4S?