Issue With Search Help in Module Pool

Dear All,
I have an Issue with Search help. I have created a Module Pool Program. In this module pool, User requires the search helps for the fields.
Imagine there are 3 fields on a screen. Field1, field2 and field3.
Field2 entries depends on field1 and field3 entries depends on field1 and field2.
I have created a collective search help. and created the corresponding Ztables to maintain the search help entries.
Now I assigned the same collective search help to both the fields . i.e. field2 and field3. But when i execute the module pool program, and press F4 on these fields , the data shown is write. BUT for the 3rd field, when I select F4, The second field values are transfered to the screen, instead of third field value.
Any Idea will be appreciated .
Help me , Its very Urgent.
Regards,

Did you check the screen field names & search help name? is it identical & unique?
Raja T

Similar Messages

  • Issues with Search Helps

    Hi Experts,
    Anyone have any advice or suggestions for this problem?
    Problem:
    When running standard SAP search helps (let's say search for material by material type - from MM03) the system seems to truncate my last character.  For example if I enter ERSA for material type - and look at the dynamic selection criteria all I see is 'ERS'.  Thus when I run my search - no results are returned.
    It is very odd behavior.
    Notes:
    - This occurs with standard and custom search helps
    - This only occurs with search helps - other fields do not have this issue
    - I recently downgraded my GUI version from 710 back to 640.  Since then I have uninstalled and re-installed many times - this does not seem to help.

    Why don't you try to login thru some other desktop that have SAPGui 7.10 and check whether its working or not.

  • How to have a search help in module pool without using Process on value req

    Can someone please tell me what r the ways if any to have F4 help in the module pool screen
    with out using POV ?

    Hi,
    They are two ways to define search help for an object...
    BY using POV
    or
    go to screen Layout and double click on the field you want F4 help and Pass the Search help math code for feild at the
    place of Search_help field aand also you can add parameter-id at this place to provide search help.
    go to screen Layout -->double click on the field you want F4 help
    -->Pass the Search help math code for feild at the place of Search_help
    save and activate..
    reagrds,
    Prabhudas

  • Date search help in module pool programming in 4.6C version

    Hi Experts,
    How can i have input help in my module pool screen, I gave the searh help EXT_DATE in the search help parameter of that screen's field parameter.
    But its not showing the input help.
    I m facing this issue in 4.6C.
    Please advise
    Thanks
    Yogesh Gupta

    Hi,
    Just to make sure that you are talking about F1 help and not F4 for input of date right?
    For F1 help of screen field, please check program for tcode: F150 (Dunning Run), You will find FM: F150_FIELD_SELECTION_HELP used for one field on screen (112).
    I guess this might help you.
    thanks,
    Ags.

  • Strange Issue With Search Help

    Hi Experts,
    I am stuck with a search help issue, when using a certain Help for an input field on my screen i am getting a "Value help dialog canceled" cancelled error , the same search help seems to be working fine
    when run from sap r/3.
    I am pretty sure the design part (Attribute binding and mentioning the search help in the context ) is correct and how it should be.
    Could Someone Please throw some lite on this issue.
    Thanks In Advance,
    Chaitanya.

    Hi Chaitanya,
    When reusing DDIC search helps in WDA, it may not always work as desired. Calls to classic screens in search help exits for example is one of the scenarios that works pretty well with SAPGUI but doesnt work with WDA.
    The following links may be of help!
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/9f724642314aabe10000000a42189b/frameset.htm
    Thanks,
    Chitrali

  • Search help in module pool programming

    Hi Guys.
    I am strugging with the following scenario.
      When i entered value in one field, getting the search help for another field...correct one.
      But when i changed the value in the first field, the search help for another field is still the same
    and is not changind based on changes value. Here is the code. Plz try to help me out.
    SELECT JOURNALRESCODE JOURNALRESNAM JOURNALCATCODE JOURNALCATDIV
             JOURNALRESTYPE
             FROM YCALCJOURNALRES
             INTO CORRESPONDING FIELDS OF TABLE GI_CATREASON
             WHERE JOURNALCATCODE = YCALCJOURNALCAT-JOURNALCATCODE
             AND   JOURNALCATDIV  = V_EANL-SPARTE.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD        = 'JOURNALRESCODE'
          VALUE_ORG       = 'S'
        TABLES
          VALUE_TAB       = GI_CATREASON
          RETURN_TAB      = RETURN_TAB
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS          = 3.
      IF SY-SUBRC <> 0.
      ELSE.
        READ TABLE RETURN_TAB INDEX 1 ASSIGNING <DDSHRETVAL>.
        IF SY-SUBRC = 0.
          YCALCJOURNALRES-JOURNALRESCODE =  <DDSHRETVAL>-FIELDVAL.
          CLEAR RETURN_TAB.
          REFRESH RETURN_TAB.
          CLEAR:GI_CATREASON,GI_CATREASON[].
        ENDIF.
      ENDIF.
    Regards,
    reddy.s

    Hi Guys.
    I got the solution and thanx for all ur replies. I need some more help from u guys.
    The drop down contains values of four fields. Now the return table from the fm F4IF_INT_TABLE_VALUE_REQUEST contains information about one retfield since i mentioned one retfield.. So far so good.
    Now my question is how can i get information about the 2nd field in the same dropdown?
          How can i mention the second retfield in the function module mentioned above?
    Thanx and Regards,
    surya.

  • Issue with Search Help Creation

    Hi All,
    I need to display the match code for the Z table ZPRODUCT and the field is PRODH. The data should be retrieved from the table T179 by filtering PRODH = 'ZZ*' and STUFE = '1'. So, I am trying to create a Search Help for this requirement. But, the field ZPRODUCT-PRODH is of 5 Characters length and the field T179-PRODH is of 18 characters length. As the lengths are not matching, it is not allowing me to create the Search help. Could someone tell me if there is any way to overcome this issue?
    Or is there any better approach to create the match code apart from the Search Help. Can we use the Table events for this requirements? Please share your thoughts.
    Thanks a lot in advance.
    Regards,
    Paddu.

    Did you check the screen field names & search help name? is it identical & unique?
    Raja T

  • Search help in module pool

    Hi ,
    I am using <b>POV</b> to call search help on a field of screen.
    i am using FM <b>'F4IF_INT_TABLE_VALUE_REQUEST'</b> to display the search help.
    My requirment is that when the user clicks on search help that field & the next field on the screen should get populated.
    i am able to assign data to the 2nd screen field but not able to display on the screen.
    Is it possible to display the 2nd screen field data?
    regards
    Kapil

    hi,
    chk this.
    FORM F_GET_details .
    REFRESH INT_RET.
    *--THIS WILL FETCH THE details
    SELECT Bill plant price
    FROM ztable_numplant
    INTO TABLE int_table.
    IF SY-SUBRC NE 0.
    *--MESSAGE IS 'NO data found'
    ELSE.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'screen field'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = INT_tab
    RETURN_TAB = INT_RET
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE INT_RET INDEX 1 INTO INT_RET.
    screen_filed1 = INT_RET-FIELDVAL.
    *second screen field obtained
    <b>read table int_table with key Bill = screen_filed1.
    screen_field2 = int_table-plant</b>
    ENDIF.
    ENDFORM.
    rgds
    anver
    if hlped mark points
    Message was edited by: Anversha s

  • Performance issue with ALV Grid in Module Pool

    Hi Experts,
    I am using an editable ALV Grid on a screen. This ALV does not have too many fields and is called in modal dialog box.
    I call this screen from a standard transaction. The problem is this screen is taking 3-4 seconds to load. I checked that fetching the data is not a problem and only after the call screen statement, the processing becomes very slow. Is this due to ALV grid. Please help as this is urgently needed and I cannot change from ALV to table control. Please suggest if anything can b done?
    Regards
    Satish

    Hi Satish,
    I hope there is a chance to do the SET_TABLE_FOR_FIRST_DISPLAY or preparation of field catalog earlier, i.e. in INITILIZATION event and then later just exchange table contents before display. That will reduce time.
    Regards,
    Clemens

  • Plz send  some help on module pool programming

    send some help on module pool programming

    Bluefox,
    SDN is not providing online learnning program. it is a forum catagery place where guys comes with real time problems.
    you should try to search by your self in GOOGLE.
    Check the below link:
    http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    You can also check the transaction ABAPDOCU which gives you lot of sample programs.
    Also you can see the below examples...
    Go to se38 and give demodynpro and press F4.
    YOu will get a list of demo module pool programs.
    One more T-Code is ABAPDOCU.
    YOu can find more examples there.
    See the prgrams:
    DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
    DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
    http://www.geocities.com/ZSAPcHAT
    http://www.allsaplinks.com/files/using_table_in_screen.pdf
    please close this thread.

  • F4 Help in Module pool and restricting the entries

    Hi all,
          I was looking how to give F4 help in module pool program and restrict the number of entries on tht event.
    Take a example of VBELN, it is having number of entries so for F4 help we first take all the entries for VBAK for VBELN and then use FM 'F4IF_INT_TABLE_VALUE_REQUEST' and pass the table.
    So how can we restrict number of entries initially 200 and then user can input number of hits.
    ( How to use Callback subroutin ).
       Waiting for valuable additions.
    Thanks,
    Anmol.

    Hi ,
        This is my query, I want to restrict the number of entries fetched by the search help depending on the user input like in standard help.
    Like VBELN is having number of records how can we asign a help to field like VBELN( for example ), is there any way to restrict the entries on search help rather than selection all the entries for tht field from database which is not good for performance. Like initially it should fetch 100 or 200 records, then if user want more entries to be fetch he can input the number of entries like in standard help. Any idea on this.
    Thanks,
    Anmol.

  • Issue with F4 help!!!!!! need to resolve it asap.

    Hello Guru's,
    I am modifying the Web Dynpro for ABAP application for employee search in HR Administrator.
    I am able to change the infoset and make use of the one I created using the enhancement framework.
    I included couple of standard fields Provided by SAP into the selection fields of the infoset.
    And now I have issue with F4 help associated with the fields.
    The problem is when you do a F4 on the selection fields the selection option which comes is having couple of columns with the key field highlighted in blue and when selecting a record or row the value selected is EN instead I would like to have the Org unit number to be selected.
    to be more clear:
    in the popup of f4 assume the columns are
    Langu Org. unit Org. Unit text.
    as of now Langu is the key field(highlighted in blue) and when selecting a row the value selected is Langu key instead I want to have Org. Unit to be selected.
    Please help me out in resolving this.
    Thanks in advacne for your time.
    Regards,
    Pramod

    Hi Pramod,
    I don't know how it is done in infoset. But if you have a context node and attribute for the field which is displayed in the view, create a custom dictionary search help for the field you want. Design the search help as per your requirements (what fields to be displayed etc..).
    In the context attribute of that field property, select 'Dictionary search help' in the Input help mode. Enter the name of your custom search help here.
    Thanks & Regards,
    Satheesh.

  • Issue with search criteriya in E-Recruiting

    Hello, Experts! I used ERECRUIT - 603(EHP3) and Trex Version -
    7.10.12.00.
    Issue with search publications in WebDynPro interface and
    BSP interface for candidate, when i use criteria for search
    (like Country, or Function Area or other...). When i use a full-
    text search or with out criteria is everything good -
    publications are find. In the TRM is every think good, with
    search criteriya or full-text search or with out criteriya. This
    problem only with publications search.

    Hello,
    Ensure you have scheduled the periodical services job RCF_PERIODICAL_SERVICES and check the tables T77RCF_EXT_PUB & T77RCF_INT_PUB in which your publications need to have a valid indicator (an "X" indication).
    If even after running the periodical services job, you are not able to view the postings, possibly there is some problem in your TREX setup and you can know where u went wrong by checking the log in SLG1 T-code.
    Best Regards
    G Raj

  • E-Recruiting.Issue with search criterion in the TRM.

    Hi all! I have some issue with search in the TRM. I want to search by range criterion.
    Example: i want to find candidate whose age between 20 - 35 years old, but in the E-Recruiting i didn't find decision how to realize this.

    Hi,
    yes you are right. I forgot that.
    But I think it is only possible if you activate SES instead of old XML based search.

  • How to raise pop up window along with radio buttons in module pool program

    how to raise pop up window along with radio buttons in module pool program

    FUNCTION zscheme_determination.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(I_KUNNR) TYPE  KUNNR
    *"  EXPORTING
    *"     REFERENCE(E_VALUE) TYPE  NETWR_AK
    *"  TABLES
    *"      G_ITEM_DATA_ITAB STRUCTURE  ZITEM_DATA
    *  TYPES: BEGIN OF ty_sord,
    *         include type ZSD_SCHEME_DTL,
    *         END   OF ty_sord.
    *  data : gt_sord type standard table of ZSD_SCHEME_DTL,
    *         wa_sord type ZSD_SCHEME_DTL.
    *  select * from ZSD_SCHEME_DTL into table
    *  gt_sord
    *  where matnr = i_matnr.
    *  T_ITEM_DATA
    *********Data Declarations
       DATA:
             salesdocumentin LIKE bapivbeln-vbeln,
             orderheaderin LIKE bapisdhd1,
             orderheaderinx LIKE bapisdhd1x,
             sender LIKE bapi_sender,
             binaryrelationshiptype LIKE bapireltype-reltype,
             intnumberassignment LIKE bapiflag-bapiflag,
             behavewhenerror LIKE bapiflag-bapiflag,
             logicswitch LIKE bapisdls,
             testrun LIKE bapiflag-bapiflag,
             convert LIKE bapiflag-bapiflag,
             return LIKE bapiret2 OCCURS 0,
             orderitemsin LIKE bapisditm OCCURS 0,
             orderitemsinx LIKE bapisditmx OCCURS 0,
             orderpartners LIKE bapiparnr OCCURS 0,
             orderschedulesin LIKE bapischdl OCCURS 0,
             orderschedulesinx LIKE bapischdlx OCCURS 0,
             orderconditionsin LIKE bapicond OCCURS 0,
             orderconditionsinx LIKE bapicondx OCCURS 0,
             ordercfgsref LIKE bapicucfg OCCURS 0,
             ordercfgsinst LIKE bapicuins OCCURS 0,
             ordercfgspartof LIKE bapicuprt OCCURS 0,
             ordercfgsvalue LIKE bapicuval OCCURS 0,
             ordercfgsblob LIKE bapicublb OCCURS 0,
             ordercfgsvk LIKE bapicuvk OCCURS 0,
             ordercfgsrefinst LIKE bapicuref OCCURS 0,
             orderccard LIKE bapiccard OCCURS 0,
             ordertext LIKE bapisdtext OCCURS 0,
             orderkeys LIKE bapisdkey OCCURS 0,
             extensionin LIKE bapiparex OCCURS 0,
             partneraddresses LIKE bapiaddr1 OCCURS 0.
       DATA : wa_orderpartners LIKE bapiparnr,
              wa_orderitemsin LIKE bapisditm,
              wa_orderitemsinx LIKE bapisditmx,
              wa_orderschedulesin LIKE bapischdl,
              wa_orderschedulesinx LIKE bapischdlx,
              wa_orderconditionsin LIKE bapicond,
              wa_orderconditionsinx LIKE bapicondx,
              wa_return LIKE bapiret2,
              lv_value TYPE netwr_ak.
       DATA : lv_dtyp TYPE char45,
              lv_sorg TYPE vkorg,
              lv_sdch TYPE vtweg,
              lv_sdiv TYPE spart.
       TYPES : BEGIN OF ty_sord,
               zsdscheme TYPE comt_scheme_id,
               posnr TYPE posnr_va,
               matnr TYPE matnr,
               disc_type TYPE rebate_disc_type,
               calc_type TYPE catyp,
               qty_from TYPE kwmeng,
               qty_to TYPE kwmeng,
               spart TYPE spart,
               custcondgrp TYPE kdkg1,
               werks TYPE werks_d,
               matmn TYPE matnr,
               END   OF ty_sord.
       DATA : gt_sord   TYPE STANDARD TABLE OF ty_sord,
              gt_sordd  TYPE STANDARD TABLE OF ty_sord,
              wa_sord TYPE ty_sord,
              wa_knvv TYPE knvv,
              lv_cal_foc TYPE p DECIMALS 3,
              lv_cal_dis TYPE p DECIMALS 3,
              lv_new_qty TYPE kwmeng,
              lv_posmat TYPE posnr_va,
              lv_posfoc TYPE posnr_va.
       DATA:lv_diff TYPE kwmeng.
    ******Schemes Selection Logic
    * Get Valid Schemes
    * Validate Scheme for validity Period, Material, Customer Type and Plant
       TYPES : BEGIN OF ty_rtab,
               sign   TYPE c LENGTH 1,
               option TYPE c LENGTH 2,
               low    LIKE mara-matnr,
               high   LIKE mara-matnr,
             END OF ty_rtab.
    *  TYPES : ty_matnr TYPE RANGE OF ty_rtab.
       DATA : it_matnr TYPE TABLE OF ty_rtab,
              wa_matnr TYPE ty_rtab,
              wa_it    TYPE zitem_data,
             wa_tab TYPE zitem_data.
    *order table declaration
       TYPES:
             BEGIN OF ty_order,
               zsdscheme TYPE comt_scheme_id,
               matnr     TYPE matnr,
               kwmeng    TYPE kwmeng,
             END OF ty_order,
       BEGIN OF ty_scheme,
        zsdscheme TYPE comt_scheme_id,
    *                matnr     TYPE matnr,
        kwmeng    TYPE kwmeng,
      END OF ty_scheme.
       DATA:
             gt_order      TYPE TABLE OF ty_order,
             gt_scheme     TYPE TABLE OF ty_scheme,
              wa_scheme    TYPE ty_scheme,
              wa_order     TYPE  ty_order.
       DATA:i_kwmeng TYPE kwmeng.
    * Transfer all the material received from order to internal table
       LOOP AT g_item_data_itab INTO wa_it.
         MOVE : wa_it-matnr TO wa_matnr-low,
                'I'          TO wa_matnr-sign,
                'EQ'         TO wa_matnr-option.
         APPEND wa_matnr TO it_matnr.
         CLEAR wa_it.
       ENDLOOP.
    * Get the Valid Schemes based on given criteria
       SELECT
               zsd_scheme_dtl~zsdscheme
               zsd_scheme_dtl~posnr
               zsd_scheme_dtl~matnr
               zsd_scheme_dtl~disc_type
               zsd_scheme_dtl~calc_type
               zsd_scheme_dtl~qty_from
               zsd_scheme_dtl~qty_to
               zsd_scheme~spart
               zsd_scheme_hdr~custcondgrp
               zsd_scheme_hdr~werks
               zsd_scheme_hdr~matnr
       FROM zsd_scheme_hdr
       INNER JOIN zsd_scheme ON zsd_scheme~zsdscheme = zsd_scheme_hdr~zsdscheme
       INNER JOIN zsd_scheme_dtl ON zsd_scheme_dtl~zsdscheme = zsd_scheme_hdr~zsdscheme
       INTO TABLE  gt_sord
       WHERE  zsd_scheme_dtl~matnr IN it_matnr
    *    zsd_scheme_hdr~matnr IN it_matnr
    *    AND zsd_scheme_hdr~werks = '1509'
         AND zsd_scheme_hdr~werks = '1529'
         AND zsd_scheme_hdr~custcondgrp = '01'
         AND zsd_scheme~datuv LE sy-datum
         AND zsd_scheme~datub GE sy-datum.
       SORT gt_sord BY zsdscheme ASCENDING.
    *  LOOP AT gt_sord INTO wa_sord.
    *    READ TABLE g_item_data_itab INTO wa_it WITH  KEY matnr = wa_sord-matnr.
    *    wa_order-zsdscheme = wa_sord-zsdscheme.
    *    wa_order-matnr = wa_it-matnr.
    *    wa_order-kwmeng = wa_it-kwmeng.
    *    COLLECT wa_order INTO gt_order.
    *    CLEAR wa_order.
    *  ENDLOOP.
       LOOP AT g_item_data_itab INTO wa_it.
         READ TABLE gt_sord INTO wa_sord WITH  KEY matnr = wa_it-matnr.
         wa_order-zsdscheme = wa_sord-zsdscheme.
         wa_order-matnr = wa_it-matnr.
         wa_order-kwmeng = wa_it-kwmeng.
         COLLECT wa_order INTO gt_order.
         MOVE : wa_sord-zsdscheme  TO wa_scheme-zsdscheme,
                wa_it-kwmeng  TO wa_scheme-kwmeng.
         COLLECT wa_scheme INTO gt_scheme.
         CLEAR : wa_order, wa_scheme.
       ENDLOOP.
       CLEAR wa_scheme.
       DATA w_line TYPE sy-tabix.
    * Updating table based on Schemes
       LOOP AT gt_scheme INTO wa_scheme.
         CLEAR w_line.
         gt_sordd[] = gt_sord[].
    *    DELETE gt_sordd WHERE zsdscheme NE wa_scheme-zsdscheme and disc_type NE 'FOC'.
         DELETE gt_sordd WHERE zsdscheme NE wa_scheme-zsdscheme AND disc_type NE 'F'.
         DELETE ADJACENT DUPLICATES FROM gt_sordd COMPARING zsdscheme matnr.
         DESCRIBE TABLE gt_sordd LINES w_line.
         IF w_line GT 1.
    * popup message to select one foc type.
         ELSE.
           CLEAR wa_sord.
           READ TABLE gt_sordd INTO wa_sord INDEX 1.
           IF sy-subrc EQ 0.
             i_kwmeng = wa_scheme-kwmeng.
             lv_cal_foc = i_kwmeng DIV wa_sord-qty_from.
             lv_cal_dis = i_kwmeng MOD wa_sord-qty_from.
             MOVE : lv_cal_foc TO wa_it-kwmeng,
                    wa_sord-matnr TO wa_it-matnr.
             APPEND  wa_it TO g_item_data_itab.
             SORT gt_order BY kwmeng DESCENDING.
             LOOP AT gt_order INTO wa_order WHERE zsdscheme = wa_scheme-zsdscheme.
               IF lv_cal_dis GT 0.
    *        LOOP AT gt_order INTO wa_order WHERE zsdscheme = wa_scheme-zsdscheme
    *                                             AND lv_cal_dis GT 0.
    *                  LOOP AT gt_order INTO wa_order WHERE zsdscheme = wa_scheme-zsdscheme.
    *                LOOP AT g_item_data INTO wa_item_data WHERE matnr EQ wa_order-matnr.
                         LOOP AT g_item_data_itab INTO wa_tab WHERE matnr EQ wa_order-matnr.
                           wa_orderconditionsin-itm_number = wa_tab-posnr.
    *                  wa_orderconditionsin-itm_number = wa_item_data-posnr.
                           wa_orderconditionsin-cond_st_no = '001'.
    *                  IF gt_sordd-calc EQ ‘post AND disc_type EQ ‘percentage’.
                           IF wa_sord-calc_type EQ 'O' AND wa_sord-disc_type EQ 'P'.
                             wa_orderconditionsin-cond_type = 'ZTPB'.   "'ZREG'.
    *                  ELSEIF gt_sordd-calc EQ ‘pre’ AND disc_type EQ ‘percentage’
                           ELSEIF wa_sord-calc_type EQ 'E' AND wa_sord-disc_type EQ 'P'.
                             wa_orderconditionsin-cond_type = 'ZTPP'.   "'ZREG'.
                           ENDIF.
                           wa_orderconditionsin-currency = 'INR'.
                           wa_orderconditionsin-conpricdat = sy-datum.
                           APPEND wa_orderconditionsin TO orderconditionsin.
                           CLEAR wa_orderconditionsin.
    *Update Discount Conditon
                         ENDLOOP.
    *                  ENDLOOP.
    *Modify balance of Item
                 CLEAR wa_tab.
                 READ TABLE g_item_data_itab INTO wa_tab WITH KEY matnr = wa_order-matnr.
                 IF sy-subrc EQ 0.
                   lv_diff = wa_tab-kwmeng - lv_cal_dis.
                   IF lv_diff GT 0.
                     wa_tab-kwmeng  = wa_tab-kwmeng - lv_cal_dis.
    *            MODIFY g_item_data TRANSPORTING kwmeng  index sy-tabix.
                     MODIFY g_item_data_itab INDEX sy-tabix FROM wa_tab TRANSPORTING kwmeng  .
                   ELSE.
                     wa_tab-kwmeng  =  lv_cal_dis.
                     lv_cal_dis  = lv_diff.
                     MODIFY g_item_data_itab INDEX sy-tabix FROM wa_tab TRANSPORTING kwmeng .
    *            MODIFY G_ITEM_DATA_ITAB TRANSPORTING kwmeng index sy-tabix.
                   ENDIF.
                   gt_sordd[] = gt_sord[].
                   DELETE gt_sordd WHERE zsdscheme NE wa_scheme-zsdscheme AND disc_type EQ 'F'.
                   DESCRIBE TABLE gt_sordd LINES w_line.
                   IF w_line GT 1.
                     SORT gt_sordd BY zsdscheme DESCENDING.
    *              SORT gt_sordd BY quantity DESCENDING.
                     CLEAR wa_sord.
    *              LOOP AT gt_sordd WHERE quantity_from LT wa_shceme-kwmeng AND quantity_to GT wa_shceme-kwmeng.
                     LOOP AT gt_sordd INTO wa_sord  WHERE qty_from LT wa_scheme-kwmeng AND qty_to GT wa_scheme-kwmeng.
    *             LOOP AT gt_order INTO wa_order WHERE scheme = wa_scheme-scheme.
                       LOOP AT gt_order INTO wa_order WHERE zsdscheme = wa_scheme-zsdscheme.
    *                LOOP AT g_item_data INTO wa_item_data WHERE matnr EQ wa_order-matnr.
                         LOOP AT g_item_data_itab INTO wa_tab WHERE matnr EQ wa_order-matnr.
                           wa_orderconditionsin-itm_number = wa_tab-posnr.
    *                  wa_orderconditionsin-itm_number = wa_item_data-posnr.
                           wa_orderconditionsin-cond_st_no = '001'.
    *                  IF gt_sordd-calc EQ ‘post AND disc_type EQ ‘percentage’.
                           IF wa_sord-calc_type EQ 'O' AND wa_sord-disc_type EQ 'P'.
                             wa_orderconditionsin-cond_type = 'ZDPD'.   "'ZREG'.
    *                  ELSEIF gt_sordd-calc EQ ‘pre’ AND disc_type EQ ‘percentage’
                           ELSEIF wa_sord-calc_type EQ 'E' AND wa_sord-disc_type EQ 'P'.
                             wa_orderconditionsin-cond_type = 'ZDPD'.   "'ZREG'.
                           ENDIF.
                           wa_orderconditionsin-currency = 'INR'.
                           wa_orderconditionsin-conpricdat = sy-datum.
                           APPEND wa_orderconditionsin TO orderconditionsin.
                           CLEAR wa_orderconditionsin.
    *Update Discount Conditon
                         ENDLOOP.
                       ENDLOOP.
                     ENDLOOP.
                   ELSE.
                   ENDIF.
                 ENDIF.
               ENDIF.
             ENDLOOP.
           ENDIF.
         ENDIF.
       ENDLOOP.
    *  select
    *          ZSD_SCHEME_DTL~ZSDSCHEME
    *          ZSD_SCHEME_DTL~POSNR
    *          ZSD_SCHEME_DTL~matnr
    *          ZSD_SCHEME_DTL~DISC_TYPE
    *          ZSD_SCHEME_DTL~CALC_TYPE
    *          ZSD_SCHEME_DTL~QTY_FROM
    *          ZSD_SCHEME_DTL~QTY_TO
    *          ZSD_SCHEME~SPART
    *          ZSD_SCHEME_HDR~CUSTCONDGRP
    *          ZSD_SCHEME_HDR~WERKS
    *          ZSD_SCHEME_HDR~MATNR
    *  from ZSD_SCHEME_DTL
    *  inner join ZSD_SCHEME on ZSD_SCHEME~ZSDSCHEME = ZSD_SCHEME_DTL~ZSDSCHEME
    *  inner join ZSD_SCHEME_HDR on ZSD_SCHEME_HDR~ZSDSCHEME = ZSD_SCHEME_DTL~ZSDSCHEME
    *  into table
    *  gt_sord
    *  where ZSD_SCHEME_DTL~matnr = i_matnr and
    *        ZSD_SCHEME~DATUV LE sy-datum and
    *        ZSD_SCHEME~DATUB GE sy-datum.
    *  break-point.
    * Process Common Logic for Schemes Processcing
       CLEAR wa_sord.
    * Convert FOC Quantity and Materials
    *  LOOP AT gt_sord INTO wa_sord.
    **   lv_cal = i_kwmeng / wa_sord-QTY_FROM.
    *    lv_cal_foc = i_kwmeng DIV wa_sord-qty_from.
    *    lv_cal_dis = i_kwmeng MOD wa_sord-qty_from.
    *  ENDLOOP.
    *lv_new_qty = i_kwmeng - lv_cal_dis.
    * Get the Sales Document Type
       SELECT SINGLE low
    FROM tvarvc
    INTO  lv_dtyp WHERE
    name = 'SD_DOC_TYPE'.
       SELECT SINGLE * FROM knvv INTO wa_knvv WHERE kunnr = i_kunnr.
       IF sy-subrc = 0.
         lv_sorg = wa_knvv-vkorg.
         lv_sdch = wa_knvv-vtweg.
         lv_sdiv = wa_knvv-spart.
       ENDIF.
    * Give the Popup for schemes with multiple FOC
    * Schemes Specific Processing
    * Schemes Specific Processing
       orderheaderin-doc_type = lv_dtyp.
       orderheaderin-sales_org = lv_sorg.
       orderheaderin-distr_chan = lv_sdch.
       orderheaderin-division = lv_sdiv.
       wa_orderpartners-partn_role = 'AG'.
       wa_orderpartners-partn_numb = i_kunnr.
       APPEND wa_orderpartners TO orderpartners.
    *    wa_ORDERPARTNERS-PARTN_ROLE = 'WE'.
    *    wa_ORDERPARTNERS-PARTN_NUMB = p_ship.
    *    append wa_ORDERPARTNERS to ORDERPARTNERS.
    * Item number begin
       CLEAR : lv_posmat.
       lv_posmat = lv_posmat + 10.
       wa_orderitemsin-itm_number = lv_posmat.
       wa_orderitemsin-material = wa_sord-matmn.  "i_matnr.
       wa_orderitemsin-target_qty = lv_new_qty.
    *  wa_ORDERITEMSIN-TARGET_QU = i_VRKME.
       APPEND wa_orderitemsin TO orderitemsin.
       wa_orderitemsinx-itm_number = lv_posmat.
       wa_orderitemsinx-material = 'X'.
       wa_orderitemsinx-target_qty = 'X'.
       wa_orderitemsinx-target_qu = 'X'.
       APPEND wa_orderitemsinx TO orderitemsinx.
       wa_orderschedulesin-itm_number = lv_posmat.
       wa_orderschedulesin-sched_line = lv_posmat.
       wa_orderschedulesin-req_qty = lv_new_qty.
       APPEND wa_orderschedulesin TO orderschedulesin.
       wa_orderschedulesinx-itm_number = lv_posmat.
       wa_orderschedulesinx-sched_line = lv_posmat.
       wa_orderschedulesinx-req_qty  = 'X'.
       wa_orderschedulesinx-updateflag = 'X'.
       APPEND wa_orderschedulesinx TO orderschedulesinx.
       wa_orderconditionsin-itm_number = lv_posmat.
       wa_orderconditionsin-cond_st_no = '001'.
       wa_orderconditionsin-cond_type = 'ZDPD'.   "'ZREG'.
       wa_orderconditionsin-currency = 'INR'.
       wa_orderconditionsin-conpricdat = sy-datum.
       APPEND wa_orderconditionsin TO orderconditionsin.
       wa_orderconditionsinx-itm_number = lv_posmat.
       wa_orderconditionsinx-cond_st_no = '001'.
       wa_orderconditionsinx-cond_type = 'ZDPD'. "'ZREG'.
       wa_orderconditionsinx-updateflag = 'X'.
       wa_orderconditionsinx-cond_value ='X'.
       wa_orderconditionsinx-currency = 'X'.
       APPEND wa_orderconditionsinx TO orderconditionsinx.
    ****18/06Beg
    *  if not lv_cal_dis is initial.
    *    lv_posmat = lv_posmat + 10.
    *    wa_ORDERITEMSIN-ITM_NUMBER = lv_posmat.
    *    wa_ORDERITEMSIN-MATERIAL = WA_SORD-MATMN.  "i_matnr.
    *    wa_ORDERITEMSIN-TARGET_QTY = lv_cal_dis.
    **  wa_ORDERITEMSIN-TARGET_QU = i_VRKME.
    *    append wa_ORDERITEMSIN to ORDERITEMSIN.
    *    wa_ORDERITEMSINX-ITM_NUMBER = lv_posmat.
    *    wa_ORDERITEMSINX-MATERIAL = 'X'.
    *    wa_ORDERITEMSINX-TARGET_QTY = 'X'.
    *    wa_ORDERITEMSINX-TARGET_QU = 'X'.
    *    append wa_ORDERITEMSINX to ORDERITEMSINX.
    *    wa_ORDERSCHEDULESIN-ITM_NUMBER = lv_posmat.
    *    wa_ORDERSCHEDULESIN-SCHED_LINE = lv_posmat.
    *    wa_ORDERSCHEDULESIN-REQ_QTY = lv_cal_dis.
    *    append wa_ORDERSCHEDULESIN to ORDERSCHEDULESIN.
    *    wa_ORDERSCHEDULESINX-itm_number = lv_posmat.
    *    wa_ORDERSCHEDULESINX-sched_line = lv_posmat.
    *    wa_ORDERSCHEDULESINX-req_qty  = 'X'.
    *    wa_ORDERSCHEDULESINX-updateflag = 'X'.
    *    append wa_ORDERSCHEDULESINX to ORDERSCHEDULESINX.
    *  endif.
    *  lv_posmat = lv_posmat + 10.
    *  wa_ORDERITEMSIN-ITM_NUMBER = lv_posmat.
    *  wa_ORDERITEMSIN-MATERIAL = i_matnr.  "WA_SORD-MATMN.
    *  wa_ORDERITEMSIN-TARGET_QTY = LV_CAL_FOC.
    *  wa_ORDERITEMSIN-ITEM_CATEG = 'ZDGN'.
    **  wa_ORDERITEMSIN-TARGET_QU = i_VRKME.
    *  append wa_ORDERITEMSIN to ORDERITEMSIN.
    *  wa_ORDERITEMSINX-ITM_NUMBER = lv_posmat.
    *  wa_ORDERITEMSINX-MATERIAL = 'X'.
    *  wa_ORDERITEMSINX-TARGET_QTY = 'X'.
    *  wa_ORDERITEMSINX-TARGET_QU = 'X'.
    *  wa_ORDERITEMSINX-ITEM_CATEG = 'X'.
    *  append wa_ORDERITEMSINX to ORDERITEMSINX.
    *  wa_ORDERSCHEDULESIN-ITM_NUMBER = lv_posmat.
    *  wa_ORDERSCHEDULESIN-SCHED_LINE = lv_posmat.
    *  wa_ORDERSCHEDULESIN-REQ_QTY = LV_CAL_FOC.
    *  append wa_ORDERSCHEDULESIN to ORDERSCHEDULESIN.
    *  wa_ORDERSCHEDULESINX-itm_number = lv_posmat.
    *  wa_ORDERSCHEDULESINX-sched_line = lv_posmat.
    *  wa_ORDERSCHEDULESINX-req_qty  = 'X'.
    *  wa_ORDERSCHEDULESINX-updateflag = 'X'.
    *  append wa_ORDERSCHEDULESINX to ORDERSCHEDULESINX.
    ****18/06End
    * Item number end
    * Switch off dialog (BAPIs always run without)
       CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
       CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
         EXPORTING
    *     SALESDOCUMENTIN               =
         order_header_in               = orderheaderin
    *     ORDER_HEADER_INX              =
    *     SENDER                        =
    *     BINARY_RELATIONSHIPTYPE       =
    *     INT_NUMBER_ASSIGNMENT         =
    *     BEHAVE_WHEN_ERROR             =
    *     LOGIC_SWITCH                  =
    *     TESTRUN                       =
    *     CONVERT                       = ' '
    *   IMPORTING
    *     SALESDOCUMENT                 =
       TABLES
         return                        = return
         order_items_in                = orderitemsin
         order_items_inx               = orderitemsinx
         order_partners                = orderpartners
         order_schedules_in            = orderschedulesin
         order_schedules_inx           = orderschedulesinx
         order_conditions_in           = orderconditionsin
         order_conditions_inx          = orderconditionsinx
    *     ORDER_CFGS_REF                =
    *     ORDER_CFGS_INST               =
    *     ORDER_CFGS_PART_OF            =
    *     ORDER_CFGS_VALUE              =
    *     ORDER_CFGS_BLOB               =
    *     ORDER_CFGS_VK                 =
    *     ORDER_CFGS_REFINST            =
    *     ORDER_CCARD                   =
    *     ORDER_TEXT                    =
    *     ORDER_KEYS                    =
    *     EXTENSIONIN                   =
    *     PARTNERADDRESSES              =
    *    commit work.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *     EXPORTING
    *       WAIT          =
    *     IMPORTING
    *       RETURN        =
       LOOP AT return INTO wa_return.
         WRITE:/ wa_return-message.
       ENDLOOP.
    ENDFUNCTION.
    *& Include ZSD_SO_CHANGES2_TOP                               Module Pool      ZSD_SO_CHANGES2
    PROGRAM  ZSD_SO_CHANGES2.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'ITEM_DATA'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   VBAP,kna1.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'ITEM_DATA'
    TYPES: BEGIN OF T_ITEM_DATA,
              POSNR LIKE VBAP-POSNR,
              MATNR LIKE VBAP-MATNR,
              KWMENG LIKE VBAP-KWMENG,
              VRKME LIKE VBAP-VRKME,
            END OF T_ITEM_DATA.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'ITEM_DATA'
    DATA:     G_ITEM_DATA_ITAB   TYPE T_ITEM_DATA OCCURS 0,
               G_ITEM_DATA_WA     TYPE T_ITEM_DATA. "work area
    DATA:     G_ITEM_DATA_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'ITEM_DATA' ITSELF
    CONTROLS: ITEM_DATA TYPE TABLEVIEW USING SCREEN 4000.
    DATA:GV_NUM TYPE I VALUE 1,
           GV_NUM2 TYPE I.
    DATA:     G_T_YREC_TAB_LINES  LIKE SY-LOOPC.***********top*************
    *& Include ZSD_SO_CHANGES2_TOP                               Module Pool      ZSD_SO_CHANGES2
    PROGRAM  ZSD_SO_CHANGES2.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'ITEM_DATA'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   VBAP,kna1.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'ITEM_DATA'
    TYPES: BEGIN OF T_ITEM_DATA,
              POSNR LIKE VBAP-POSNR,
              MATNR LIKE VBAP-MATNR,
              KWMENG LIKE VBAP-KWMENG,
              VRKME LIKE VBAP-VRKME,
            END OF T_ITEM_DATA.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'ITEM_DATA'
    DATA:     G_ITEM_DATA_ITAB   TYPE T_ITEM_DATA OCCURS 0,
               G_ITEM_DATA_WA     TYPE T_ITEM_DATA. "work area
    DATA:     G_ITEM_DATA_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'ITEM_DATA' ITSELF
    CONTROLS: ITEM_DATA TYPE TABLEVIEW USING SCREEN 4000.
    DATA:GV_NUM TYPE I VALUE 1,
           GV_NUM2 TYPE I.
    DATA:     G_T_YREC_TAB_LINES  LIKE SY-LOOPC.
    ************************pbo*******************
    *&  Include           ZSD_SO_CHANGES2_PBO
    *&SPWIZARD: OUTPUT MODULE FOR TC 'ITEM_DATA'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    MODULE ITEM_DATA_INIT OUTPUT.
       IF G_ITEM_DATA_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'VBAP'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_ITEM_DATA_itab'
    *    SELECT * FROM VBAP
    *       INTO CORRESPONDING FIELDS
    *       OF TABLE G_ITEM_DATA_ITAB.
    *    G_ITEM_DATA_COPIED = 'X'.
         REFRESH CONTROL 'ITEM_DATA' FROM SCREEN '4000'.
       ENDIF.
       ITEM_DATA-LINES = G_T_YREC_TAB_LINES + 15.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'ITEM_DATA'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE ITEM_DATA_MOVE OUTPUT.
       MOVE-CORRESPONDING G_ITEM_DATA_WA TO VBAP.
    ENDMODULE.
    *&      Module  STATUS_4000  OUTPUT
    *       text
    MODULE STATUS_4000 OUTPUT.
       SET PF-STATUS 'APAR'.
    *  REFRESH G_ITEM_DATA_ITAB.
        GV_NUM = 1.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_4000  OUTPUT

Maybe you are looking for

  • Bill to Return order - Pricing procedure determination

    Hi Need expert advice on following customization.  We have a return order getting created with reference to F2 invoice.  We need to have a new pricing procedure determined in the return order instead of the pricing procedure copying from F2. I have c

  • Uploaded files to iCloud resulting in iPhone local storage reduced dramatically

    Hi, I have just uploaded 12GB of files including PDFs, text files, images, videos etc into iCloud Drive via my iMac (Yosemite). However, I noticed that my iPhone storage which initially has 10GB free was reduced to just 1GB, with iOS prompting me on

  • Can you establish a Java enviroment w/o downloading and installing JAVA?

    Hello, I am a fifteen-year-old, JAVA compatible teenager in Northern VA. I am trying to find a simple and easy way to run a JAVA application (using the ".class" files, of course) on a windows platform, hopefully without have to go through a complex i

  • SOAP reciever channel inactive

    I have a SOAP reciever adapter but in RWB communication channel monitoring it shows tobe "Started but inactive" Can anyone suggest any possible reason and solution

  • AVI in Premiere Problem - HELP!

    I am migrating from a PC to a new Mac Pro and I transferred an old Premiere project. All the movie files were AVI. When I open the project on the Mac it tells me that its codec is missing. Can someone point me to the right codec and where I can get i