Issue with function module exits

Hi,
execute the T.Code MK01, enter the language 'English' and country 'de'. it's allowing to save the data. I want to raise one pop-up message as 'country and language are not the valid combination please choose right one'. I enhanced in the function module exit. it's raising the message , but it's executing the next screen. how to stop it's first screen and I have to choose the right combination even though  I raised message as Error, it's repeating same thing. Please give me any suggestion on this issue.
Thanks & Regards,
Seshu.

I have executed CMOD T.Code,  we can find the 'include zxf05u01'  program . I wrote the code in this include program.  select statement is like this. check the code here.
" select single land1
                       spras
              into wa_t005
             from t005
            where land1 = i_lfa1-land1
            and     spras = I_lfa1-spras.
if sy-subrc <>0.
country &1 and language &2 are not the valid combination.
message e015(zall) with I_lfa1-land1 I_lfa1-spras.
endif."

Similar Messages

  • Issue with Function Module...

    Hi Frnzs,
    Here is my issue..Plz go thru it..
    I have a function module (YFSF_ICR_GET_EXCHG_RATE_ODS).
    the function performs the current logic without any changes,
    that is reading SPOT rates for actuals (the planning cycle is empty) or S rates
    for forecasts based on the planning cycle. Nothing needs to be changed here
    concultion : Based on flag I_ICR ni , we have to read new exchange rates ( From ODS)
    the fucntion module code is here
    FUNCTION yfsf_icr_get_exchg_rate_ods.
    ""Local interface:
    *" IMPORTING
    *" REFERENCE(I_PLANCYC) TYPE /BIC/OIYPLANCYC OPTIONAL
    *" REFERENCE(I_SALESORG) TYPE /BI0/OISALESORG OPTIONAL
    *" REFERENCE(I_IC) TYPE /BIC/OIYINVCURR
    *" REFERENCE(I_RC) TYPE /BIC/OIYREPCURR
    *" REFERENCE(I_FISCPER) TYPE /BI0/OIFISCPER
    *" EXPORTING
    *" REFERENCE(E_EXG) TYPE /BI0/OIEXCHG_RATE
    *" EXCEPTIONS
    *" NO_RATE_FOUND
    DATA: l_s_exg TYPE /bic/ayfsfexg00,
    l_t_exg TYPE /bic/ayfsfexg00 OCCURS 0,
    l_year TYPE /bi0/oifiscyear.
    IF i_plancyc IS INITIAL.
    Actuals
    FREE l_t_exg.
    SELECT *
    INTO CORRESPONDING FIELDS OF TABLE l_t_exg
    FROM /bic/ayfsfexg00
    WHERE fiscper <= i_fiscper
    AND fiscvarnt = 'JJ'
    AND /bic/yrepcurr = i_rc
    AND /bic/yinvcurr = i_ic
    AND /bic/yplancyc = ''
    AND /bic/yexchtype = 'SPOT'
    ORDER BY fiscper DESCENDING.
    IF sy-subrc <> 0.
    RAISE no_rate_found.
    ELSE.
    READ TABLE l_t_exg INTO l_s_exg INDEX 1.
    e_exg = l_s_exg-exchg_rate.
    ENDIF.
    ELSE.
    Forecasts
    l_year = i_fiscper+0(4).
    SELECT SINGLE *
    INTO l_s_exg
    FROM /bic/ayfsfexg00
    WHERE fiscvarnt = 'JJ'
    AND fiscyear = l_year
    AND salesorg = i_salesorg
    AND /bic/yrepcurr = i_rc
    AND /bic/yinvcurr = i_ic
    AND /bic/yplancyc = i_plancyc
    AND /bic/yplancyc = ''
    AND /bic/yexchtype = 'S'
    AND exchg_rate GE '0.0000001'.
    IF sy-subrc <> 0.
    RAISE no_rate_found.
    ELSE.
    e_exg = l_s_exg-exchg_rate.
    ENDIF.
    ENDIF.
    ENDFUNCTION.
    ok
    now my requirement is that I need to enhance the Function module for reading exchange rates.
    for this i got the following information:
    - It requires an additional flag I_ICR for instance that can be empty or 'X'
    for instance
    - If the flag is empty, the function performs the current logic without any changes,
    that is reading SPOT rates for actuals (the planning cycle is empty) or S rates
    for forecasts based on the planning cycle. Nothing needs to be changed here
    - If the flag is 'X', the function reads a new exchange rate type, let's call
    it "ICR". As stated in the requirements and functional specs, these exchange rates
    are the Reuter rates valid for a complete year. These are fixed rates so no planning
    cycle. The users will enter records in the format (year, reporting currency, invoicing
    currency, exchange rate). If the input flag I_ICR is X, the function determines
    the year based on the input period, then, based on the year it selects on the same
    table as for the other exchange rates with a restriction on exchange rate type "ICR",
    year, from and to currency and return the exchange rate
    Update rules. There are two:
    - To the consolidation ODS. No changes are required there; the function has to
    read either S or SPOT rates (I_ICR flag is empty)
    - From the consolidation ODS to the cube. As stated in my previous email, the
    from currency is the one available in the data package. The to currency is determined by reading the sales organization master data (reporting currency attribute) based on the inter-company sales organization (also available in the incoming record). It then calls the function module above with the parameter I_ICR set to 'X' so it reads the Reuter rates.
    I guess i need to create another function module and can be used.
    Observation
    ODS table fields.
    - FISCPER
    - FISCVARNT JJ
    - FISCYEAR 2006
    - /BIC/YREPCURR EUR
    - /BIC/YINVCURR JPY
    - SALESORG 0010
    - /BIC/YMRC 3090
    - /BIC/YPLANCYC
    - /BIC/YEXCHTYPE S
    - - RECORDMODE
    Thanx in advance..

    Hi Badrinath,
    Welcome to SDN,
    If i guess right then you are asking the question that whether to include the new functionality in existing function module or not.
    You can edit the same function module.
    but prefrably u can create a new function module.
    you have all the details with you u need to check the condition of  I_ICR in calling program and then call the new FM or the old one.
    creating new function module will also keep the modularisation and clean code.
    Hope this helps

  • Issue with function module updated values

    Hi Experts,
    We have an issue with customized program. In this program function module 'BBP_PD_SC_GETDETAIL' not picking
    the updated values when the UI was opened. But when we were executing the same function module directly by providing the values manually it is picking up the correct data.
    We thought it was a problem with session killing or buffer refresh ? We dont know how to handle this issue.
    If you have any suggestions that would be great help full for me . Please reply asap.
    Regards,
    Chandu

    Hi,
    Thanks for your quick reply.
    I have passed the values to the function module in the program and also used the same values for manually testing of the function module. Getting the correct values when I was testing manually.
    We thought it was a session killing problem as we developed the customized code. So any idea how to refresh the session even
    though the UI(User Interface) was opened.
    This issue was solved when the UI was closed and opened again.
    Any other ideas on this issue ?
    Regards,
    Chandu

  • Issue with function module HR_INFOTYPE_OPERATION in badi HRPAD00INFTY

    Hello All,
    I have a business scenario wherein, when user saves data for infotype 0002 from tcode PA30, i have create a new record for infotype 0105 by copying existing record and just changing the date.
    For the same I am using funtion module HR_INFOTYPE_OPERATION inside badi HRPAD00INFTY method AFTER_INPUT.
    When I am running the same function module in a independent program, its running fine. But when I run it inside the badi method, it runs with sy-subrc = 0 and no error, but later in the standard program MP000200,in pai module PRE_INPUT_CHECK, it tries to execute this statement     MOVE <namst> TO <subty> and gives dump, with runtime error MOVE_TO_LIT_NOTALLOWED_NODATA and saying that "Error at assignment: Overwritten protected field.".
    Have tried all the options of function module HR_INFOTYPE_OPERATION, but nothing is helping.
    Kindly let me know if any information on the same.
    Best Regards,
    Rahul Malani

    Have you checked what's in the Subtype field of table T777D for infotype 0002?
      IF t777d-namst ne space.                                  "QNOK025939
        MOVE <namst> TO <subty>.
      ENDIF.
    Usually this sentence won't be executed unless there is something in that field. Usually we don't have subtypes for IT0002.
    Also make sure that the infotype that gives the dump is 0002 and not 0105.
    Regards.

  • Flex2.0 issue with function modul

    Hi Experts,
    I have a problem within the Visual Composer. When I enter a value for a variable and we push the button to run the function module rsr_var_pers_var_set the paramter for the variable is not transferred to the DSO Personalisierungs Daten für Variablen Ersetzung. We have compiled our model with the flex2.0. When we compile the model with the flex1.5 it works. Is this a bug. Is there any workaround for the flex 2.0?
    Thanks
    Matthias

    Hi Amiya,
    I have more than 10 variables in the selection screen and I would like to personalize all of them when the user has select or enter his values. Therefore I use the function module RSR_VAR_PERS_VAR_SET. But in the VC model I have to connect for each variable the selection screen with the function module, because I didn`t know if it is possible to call the function module one time for all variables. (When you add the function module to the VC model it`s not possible to enter the parameters for more than one variable.)
    Matthias

  • Issue with function module SO_NEW_DOCUMENT_ATT_SEND_API1

    Hi,
    I am new to web dynpro abap.In my application ,im using  'SO_NEW_DOCUMENT_ATT_SEND_API1 function module to send mail.
    Application is working fine ,but in code inspector im get error like
    Undesirable statement SUBMIT !
    Plz help me to solve
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = lt_mailsubject
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = lt_packing_list
          contents_bin               = lt_attachment
          contents_txt               = lt_mailtxt
          receivers                  = lt_mailrecipients
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc EQ 0.
        SUBMIT rsconn01 WITH MODE = 'INT' AND RETURN.
      ENDIF.
    Edited by: amrutha_prabhu2000 on Mar 29, 2011 6:32 AM

    Hi Amrutha and roopa,
    Please go through this.. it might solve your problem.
    WebDynpro ABAP
    Re: how to send an email with an attachment using webdynpros
    Cheers,
    Kris.

  • Data alignment issue with function module SO_DOCUMENT_SEND_API1

    Hi All,
    I am using function SO_DOCUMENT_SEND_API1 to send email from SAP. What is happening is the internal table which contains the data of the email(Content of the email) is ok. That is data in internal table is in proper format as required. This table is passed to FM SO_DOCUMENT_SEND_API1. After execution of this FM, mail is sent but the format of the email content is not the same as the format of the data in internal table.
    Can anyone guide me regarding this discrepancy in the data alignment or format in the actual email ?
    Thanks in advance.
    Regards,
    Chetan

    Hi,
    Pass the values like the following format,
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
        EXPORTING
          document_data  = docdata
          put_in_outbox  = 'X'
          commit_work    = 'X'
        TABLES
          object_content = objcont
          receivers      = intrcvers[].
      CASE int_error.
        WHEN 0.
          MESSAGE s888(sabapdocu) with "Mail Sent Successfully...".
        WHEN OTHERS.
          MESSAGE s888(sabapdocu) with "Mail Not Sent...".
      ENDCASE
    I hope this will solve your problem.
    Gothrough the following link,
    https://forums.sdn.sap.com/click.jspa?searchID=14853082&messageID=5409233
    Regards,
    Harish

  • Issue on Function Module

    Hi Gurus
    I have an issue with function module, i am passing a filepath to the function module which is like this /temp/folder/AFILE.csv.
    to pull the data from application server. When ever it enters to the function module it is changing the file name as /TEMP/FOLDER/AFILE.CSV( it is changing the entire thing to capitol letters), I just want to know that there is any way where i can pass the file path as it is.
    Regards
    Kumar.

    If it is a custom Function module then goto the domain of the file parameter of the FM (if u r using std. domain then change it to a custom domain)  and set the lowercase checkbox under Definition tab.
    Regards,
    Joy.

  • Function modules in function module exits

    Hi,
    Could you please clarify the concepts of function moduels and funtion 'X' modules in function module exits.
    Thanks in advance.

    Hi mallela,
    1. in user-exits,
       this thing happens.
    a) the main program,
        somewhere in the code, (eg. before saving)
        calls the SPECIAL SYNTAX
       CALL CUSTOMER-FUNCTION '001'.
    b) This special syntax
       searches for a FM
       with the following format of name.
      'EXIT' +   CURRENT PROGRAMNAME + '001'
      c) This new found FM
        is called in which parameters  
        are imported/exported etc.
      d) THIS FM is called X FM for user-exit.
    2. This X FM is also but a simple FM,
       the only difference is
       a) its naming convention
       b) its detected by the special syntax
    regards,
    amit m.

  • Function module exit transportation(plng area: varible population)

    hi,
    in plng area, i populated one variable(calmonth) based on variable(fiscal year)  using function module exit.
    Now i want to transport plng area from dev system  to production. Is it mandaory that function module should transport separately or when i transport plng area: is function module transported automatically?
    thanks

    thanks for replies..
    i went to se80, selected my fun group->context menu->display object directory entry.. i'm seeing this option(display object directory entry) ..instead of creation of TR, and may be  because here system shows it locked by paricular workbench req.
    i cheked workbench req it is having same fun group with set of other fun module ..now how i can i include my new fun module into that req? or do i need release that request first and then create separate new req for this fun module?
    regds

  • Generic Data Source with Function Module data mismatch in BI

    Hi All,
    I'm using Generic Data Source with Function Module, When I execute the Function Module (Which I have Created), I'm getting 16000 records and when run extractor(in RSA3) im getting different no.of records(infact they are more no.).
    when I run the InfoPackage in BI im Getting more no. of records than what i got executing the function module..
    and single record is divided into 2 records in BI side(not all the records), how can it be possible???
    is there anything Im missing to explain you my issue???
    if understood please help me out.
    Thanks n Regards,
    ravi.

    the datasource frame work starts the function module several times.
    1. the initialization
    2. the serval times, until you "raise no_more_data".
    check you coding: have you refreshed necessary internal tables.
    Sven

  • Generic Data Source with Function Module data mismatch

    Hi All,
    I'm using Generic Data Source with Function Module, When I execute the Function Module (Which I have Created), I'm getting 16000 records and when run extractor(in RSA3) im getting different no.of records(infact they are more no.).
    when I run the InfoPackage  in BI im Getting more no. of records than what i got executing the function module..
    and single record is divided into 2 records in BI side(not all the records), how can it be possible???
    is there anything Im missing to explain you my issue???
    if understood please help me out.
    Thanks n Regards,
    ravi.

    HI rkiranbi,
    1. FIrst you excute function module according to your paramers, you will get some records. then goto tcode RSA3 --> excute
    Provide your Data source name and under setting we have options like Data records/calls, Display extractor calls and selections --> fields .
    in that options you have to increase the values. and then you have to pass paramers in RSA3 according to your function module
    selections in SE37. Now you will get equal values in both functin module selection and RSA3 Selection. if it fail means  you need to
    check coding logic in function module. 
    2. if your  are getting wrong values in BI System then check with
                  1. compare with PSA data and data target data (here you need to check with characterstic as well as keyfigures)
                  if you find any mistake you need change the coding in function module according to client requirement.
                  2. compare data with RSA3 and bi report data or data target data.
                                 check it properly above steps, you will get solution.
    thanks and regards,
    malli

  • VirtualProvider with Function module problem !

    I implemented virtualprovider with function module. Unfortunately  when I run query i get message error :
    u201CFunction call of ZT0X failed; the obligatory parameter CHARACTERISTICS
    An exception with the type CX_SY_DYN_CALL_PARAM_MISSING occurred, but was
    I>> Row: 67 Inc: READ_DATA Prog: CL_RSDRV_VPROV_LOC_NOSIDu201D
    Any suggestions ?
    Below source code:
    u201CFUNCTION ZT0X.
    ""Lokalny interfejs:
    *"  IMPORTING
    *"     VALUE(INFOCUBE) LIKE  BAPI6200-INFOCUBE DEFAULT 'ZT03'
    *"     VALUE(KEYDATE) LIKE  BAPI6200-KEYDATE OPTIONAL
    *"  EXPORTING
    *"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"  TABLES
    *"      SELECTION STRUCTURE  BAPI6200SL
    *"      CHARACTERISTICS STRUCTURE  BAPI6200FD
    *"      KEYFIGURES STRUCTURE  BAPI6200FD
    *"      DATA STRUCTURE  BAPI6100DA
    DATA:
        l_r_srv              TYPE ref to CL_RSDRV_REMOTE_IPROV_SRV,
        l_th_mapping         TYPE CL_RSDRV_REMOTE_IPROV_SRV=>TN_TH_IOBJ_FLD_MAPPING.
    *  break-point ID ZRSDRV_RC1.
    * break DEVELOPER.
      perform build_mapping_table
        changing l_th_mapping.
      create object l_r_srv
        exporting
          i_tablnm              = '/BIC/PZPRD_ID'
          i_th_iobj_fld_mapping = l_th_mapping.
      l_r_srv->open_cursor(
        i_t_characteristics = characteristics[]
        i_t_keyfigures      = keyfigures[]
        i_t_selection       = selection[] ).
       l_r_srv->fetch_pack_data(
        importing
          e_t_data = data[] ).
      return-type = 'S'.
    ENDFUNCTION.
    &---- <
    *&        Form  build_mapping_table
    &---- <
    Form build_mapping_table
      changing
        c_th_mapping TYPE CL_RSDRV_EXTERNAL_IPROV_SRV=>TN_TH_IOBJ_FLD_MAPPING.
      DATA:
        l_s_map TYPE CL_RSDRV_EXTERNAL_IPROV_SRV=>TN_S_IOBJ_FLD_MAPPING.
      l_s_map-iobjnm = 'ZPRD_ID'.
      l_s_map-fldnm  = '/BIC/ZPRD_ID'.
      insert l_s_map into table c_th_mapping.
      l_s_map-iobjnm = 'ZWARTOSC'.
      l_s_map-fldnm  = '/BIC/Z_CEN_W'.
      insert l_s_map into table c_th_mapping.
    +endform.u201D

    Hello
    I experienced the same issue. Were u able to solve it? If yes , kindly ask you to make posting here so that others can benefit as well.
    Huge thanks

  • Function module Exit.............URGENT

    Hi Experts,
    I got a new requirement to add the filed Mfr Name to the PO.
    Please guide through the complete process.
    ( which Function module exit do i need to update and how)
    Thanks in advance.

    Hai.
    check the example code.
    REPORT Z_SALES_ORDER_CHANGE
    NO STANDARD PAGE HEADING
    LINE-SIZE 132
    LINE-COUNT 65(0)
    MESSAGE-ID ZZ.
    TABLES: VBAP.
    DATA:
    V_FILEIN(90) TYPE C,
    V_RECIN TYPE I,
    V_RECVBAP TYPE I,
    V_RECORDER TYPE I,
    V_VBELN LIKE VBAP-VBELN,
    ORDERHEADERINX LIKE BAPISDH1X.
    DATA: BEGIN OF I_ORDERS OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    BRGEW(18) TYPE C,
    VOLUM(18) TYPE C,
    END OF I_ORDERS.
    DATA: BEGIN OF I_OUTPUT OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    GEWEI LIKE VBAP-GEWEI,
    BRGEW LIKE VBAP-BRGEW,
    VOLUM LIKE VBAP-VOLUM,
    CKWGT TYPE C,
    CKVOL TYPE C,
    END OF I_OUTPUT.
    DATA: BEGIN OF ORDERITEMIN OCCURS 0.
    INCLUDE STRUCTURE BAPISDITM.
    DATA: END OF ORDERITEMIN.
    DATA: BEGIN OF ORDERITEMINX OCCURS 0.
    INCLUDE STRUCTURE BAPISDITMX.
    DATA: END OF ORDERITEMINX.
    DATA: BEGIN OF RETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF RETURN.
    DATA: BEGIN OF BAPIRETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF BAPIRETURN.
    PARAMETERS:
    P_PATH(45) TYPE C DEFAULT '/usr/users/ftpsapom/' LOWER CASE,
    P_FNAME(32) TYPE C DEFAULT '/sweetjo.txt' LOWER CASE.
    START-OF-SELECTION.
    CONCATENATE PATH AND FILE NAME INTO ONE VARIABLE
    CONCATENATE P_PATH P_FNAME INTO V_FILEIN.
    OPEN DATASET
    IF V_FILEIN IS INITIAL.
    MESSAGE E002 WITH 'FILE' V_FILEIN 'DOES NOT CONTAIN ANY DATA!'.
    ELSE.
    OPEN DATASET V_FILEIN
    FOR INPUT
    IN TEXT MODE.
    IF SY-SUBRC = 0.
    READ DATASET
    DO.
    READ DATASET V_FILEIN INTO I_ORDERS.
    IF SY-SUBRC = 0.
    APPEND I_ORDERS.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET
    CLOSE DATASET V_FILEIN.
    IF SY-SUBRC <> 0.
    MESSAGE E002 WITH 'ERROR - CLOSING' V_FILEIN.
    ENDIF.
    ELSE.
    MESSAGE E002 WITH 'ERROR - COULD NOT OPEN' V_FILEIN.
    ENDIF.
    ENDIF.
    SORT AND REMOVE DUPLICATES FROM I_ORDERS
    SORT I_ORDERS BY VBELN POSNR.
    DELETE ADJACENT DUPLICATES FROM I_ORDERS.
    POPULATE I_OUTPUT
    LOOP AT I_ORDERS.
    SHIFT I_ORDERS-POSNR LEFT DELETING LEADING SPACE.
    CONCATENATE '0' I_ORDERS-POSNR INTO I_ORDERS-POSNR.
    SELECT SINGLE BRGEW VOLUM
    FROM VBAP
    INTO (VBAP-BRGEW, VBAP-VOLUM)
    WHERE VBELN = I_ORDERS-VBELN
    AND POSNR = I_ORDERS-POSNR.
    IF SY-SUBRC = 0.
    IF VBAP-BRGEW = 0.
    I_OUTPUT-CKWGT = 'X'.
    ENDIF.
    IF VBAP-VOLUM = 0.
    I_OUTPUT-CKVOL = 'X'.
    ENDIF.
    I_OUTPUT-VBELN = I_ORDERS-VBELN.
    I_OUTPUT-POSNR = I_ORDERS-POSNR.
    I_OUTPUT-GEWEI = 'ST'.
    I_OUTPUT-BRGEW = I_ORDERS-BRGEW.
    I_OUTPUT-VOLUM = I_ORDERS-VOLUM.
    APPEND I_OUTPUT.
    CLEAR: I_OUTPUT.
    ENDIF.
    V_RECIN = V_RECIN + 1.
    ENDLOOP.
    POPULATE BAPI DATA AND RUN BAPI
    CLEAR: ORDERHEADERINX, ORDERITEMIN, ORDERITEMINX,
    RETURN, BAPIRETURN.
    REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
    ORDERHEADERINX-UPDATEFLAG = 'U'.
    LOOP AT I_OUTPUT WHERE CKWGT = 'X' OR CKVOL = 'X'.
    V_RECVBAP = V_RECVBAP + 1.
    IF I_OUTPUT-VBELN <> V_VBELN AND SY-TABIX <> 1.
    V_RECORDER = V_RECORDER + 1.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = V_VBELN
    ORDER_HEADER_INX = ORDERHEADERINX
    TABLES
    RETURN = RETURN
    ORDER_ITEM_IN = ORDERITEMIN
    ORDER_ITEM_INX = ORDERITEMINX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPIRETURN.
    WRITE OUT RETURN
    LOOP AT RETURN.
    WRITE: / RETURN.
    ENDLOOP.
    WRITE: / BAPIRETURN.
    SKIP.
    CLEAR: ORDERITEMIN, ORDERITEMINX,
    RETURN, BAPIRETURN.
    REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
    ENDIF.
    ORDERITEMIN-ITM_NUMBER = I_OUTPUT-POSNR.
    ORDERITEMIN-UNTOF_WGHT = I_OUTPUT-GEWEI.
    IF NOT I_OUTPUT-CKWGT IS INITIAL.
    ORDERITEMIN-GROSS_WGHT = I_OUTPUT-BRGEW.
    ORDERITEMINX-GROSS_WGHT = 'X'.
    ENDIF.
    IF NOT I_OUTPUT-CKVOL IS INITIAL.
    ORDERITEMIN-VOLUME = I_OUTPUT-VOLUM.
    ORDERITEMINX-VOLUME = 'X'.
    ENDIF.
    APPEND ORDERITEMIN.
    ORDERITEMINX-ITM_NUMBER = I_OUTPUT-POSNR.
    ORDERITEMINX-UNTOF_WGHT = 'X'.
    ORDERITEMINX-UPDATEFLAG = 'U'.
    APPEND ORDERITEMINX.
    V_VBELN = I_OUTPUT-VBELN.
    ENDLOOP.
    RUN BAPI ON LAST ORDER
    IF NOT ORDERITEMIN IS INITIAL.
    V_RECORDER = V_RECORDER + 1.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = V_VBELN
    ORDER_HEADER_INX = ORDERHEADERINX
    TABLES
    RETURN = RETURN
    ORDER_ITEM_IN = ORDERITEMIN
    ORDER_ITEM_INX = ORDERITEMINX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPIRETURN.
    WRITE OUT RETURN
    LOOP AT RETURN.
    WRITE: / RETURN.
    ENDLOOP.
    WRITE: / BAPIRETURN.
    SKIP.
    ENDIF.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT FROM FILE ', V_RECIN.
    SKIP.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT OF LINES TO CHANGE ', V_RECVBAP.
    SKIP.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT OF ORDERS TO CHANGE ', V_RECORDER.
    SKIP.
    TOP OF PAGE
    TOP-OF-PAGE.
    WRITE:/1(5) TEXT-H01, 6(8) SY-DATUM MM/DD/YY,
    100(8) TEXT-H02, 126(8) SY-PAGNO.
    WRITE:/1(5) TEXT-H03, 6(8) SY-UZEIT USING EDIT MASK '__:__:__',
    20(77) TEXT-H04,
    100(8) TEXT-H05, 108(25) SY-REPID.
    WRITE:/1(6) TEXT-H06, 8(12) SY-UNAME,
    20(4) TEXT-H07, 25(32) SY-HOST,
    100(13) TEXT-H08, 121(8) SY-SYSID,
    129 '/', 130(3) SY-MANDT.
    ULINE.
    SKIP.
    DATA: LWA_HEADER_DATA LIKE BAPIOBDLVHDRCHG,
    LWA_HEADER_CONTROL LIKE BAPIOBDLVHDRCTRLCHG,
    LT_ITEM_DATA LIKE TABLE OF BAPIOBDLVITEMCHG,
    LWA_ITEM_DATA LIKE LINE OF LT_ITEM_DATA,
    LV_OLD_DELIV LIKE GWA_SD_DOCUMENT-VBELN,
    LV_NEW_DELIV LIKE GWA_SD_DOCUMENT-VBELN,
    LV_OLD_MATNR LIKE GWA_SD_DOCUMENT-MATNR,
    LV_NEW_MATNR LIKE GWA_SD_DOCUMENT-MATNR,
    LV_OLD_SHIP LIKE GWA_SD_DOCUMENT-TKNUM,
    LWA_TECHN LIKE BAPIDLVCONTROL,
    LT_ITEM_CONTROL LIKE TABLE OF BAPIOBDLVITEMCTRLCHG,
    LWA_ITEM_CONTROL LIKE LINE OF LT_ITEM_CONTROL,
    LV_NEW_SHIP LIKE GWA_SD_DOCUMENT-TKNUM,
    LT_RETURN LIKE TABLE OF BAPIRET2.
    *Local data --> End
    LWA_TECHN-UPD_IND = GC_DEFAULT.
    LOOP AT GT_SD_DOCUMENT INTO GWA_SD_DOCUMENT.
    LWA_ITEM_DATA-DELIV_NUMB = GWA_SD_DOCUMENT-VBELN.
    LWA_ITEM_DATA-DELIV_ITEM = GWA_SD_DOCUMENT-POSNR.
    LWA_ITEM_DATA-MATERIAL = GWA_SD_DOCUMENT-MATNR.
    LWA_ITEM_DATA-DLV_QTY = GWA_SD_DOCUMENT-LFIMG_R.
    LWA_ITEM_DATA-DLV_QTY_IMUNIT = GWA_SD_DOCUMENT-LFIMG_R.
    LWA_ITEM_DATA-SALES_UNIT = GWA_SD_DOCUMENT-VRKME.
    LWA_ITEM_DATA-BASE_UOM = GWA_SD_DOCUMENT-MEINS.
    APPEND LWA_ITEM_DATA TO LT_ITEM_DATA.
    LWA_ITEM_CONTROL-DELIV_NUMB = GWA_SD_DOCUMENT-VBELN.
    LWA_ITEM_CONTROL-DELIV_ITEM = GWA_SD_DOCUMENT-POSNR.
    LWA_ITEM_CONTROL-CHG_DELQTY = GC_DEFAULT.
    APPEND LWA_ITEM_CONTROL TO LT_ITEM_CONTROL.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
    EXPORTING
    HEADER_DATA = LWA_HEADER_DATA
    HEADER_CONTROL = LWA_HEADER_CONTROL
    DELIVERY = LV_OLD_DELIV
    TABLES
    ITEM_DATA = LT_ITEM_DATA
    ITEM_CONTROL = LT_ITEM_CONTROL
    RETURN = LT_RETURN.
    ENDLOOP.
    BAPI_OUTB_DELIVERY_CHANGE
    Regards.
    sowjanya.b

  • Can anyone tell me steps to be taken while modifying a function module exit

    Hi guys,
    I have to make little changes to function module exits in a project .
    what are the necessary steps i need to take make the changes and make them work.
    Thanks,
    Venkat

    1.  Create a project in CMOD
    2.  Assign the exit definition name (From SMOD)
    3.  Select the function module you would like to implement from the components screen
    4.  Double click on the include name within the function module, create the include if not already created
    5.  Add your code to the include program
    6. Save and activate your code
    7.  Save and activate your CMOD Project
    Best Regards,
    Chris H.

Maybe you are looking for