Module pool - to save number range

hi all,
when i save the entry one number is generated through number range object, but if i press again save, next number is generated, this happens every time i save the entry. how to avoid this?
Thanks

hi,
i have written the foll. code,  i have to add more than 1 entry in itab , after adding all the entry i save it , but when i add 1st entry and press enter it goes to screen 1001 ie initial screen,
when 'SAVE'.
move itab-reldt+4(2) to sub.
MOVE ITAB-RELDT+0(4) TO YEAR.
SELECT SINGLE * FROM NRIV INTO ZNRIV WHERE OBJECT = 'ZABC'
AND SUBOBJECT = SUB AND TOYEAR = YEAR.
call function 'NUMBER_RANGE_ENQUEUE'
         exporting
               object              = 'ZABC'   "Create with SNUM
         exceptions
               foreign_lock        = 1
               object_not_found    = 2
               system_failure      = 3
               others              = 4.
if sy-subrc ne 0.
  message e086 with 'Lock error' sy-subrc.
endif.
CALL FUNCTION 'NUMBER_GET_NEXT'
  EXPORTING
    nr_range_nr                   = ZNRIV-NRRANGENR
    object                        = 'ZABC'
   IGNORE_BUFFER                 = 'X'
   SUBOBJECT                     = SUB
   TOYEAR                        = YEAR
IMPORTING
   NUMBER                        = NUM.
LOOP AT ITAB.
MOVE NUM TO ITAB-CODE.
MODIFY ITAB.
message W012(zdes) with ITAB-CODE.
insert ZDESIGN FROM TABLE ITAB.
CLEAR OK_CODE.
clear itab.
*clear zdesign.
ENDLOOP.
call function 'NUMBER_RANGE_DEQUEUE'
    exporting
      object                 = 'ZABC'.
*WHEN 'MODI'.
SET SCREEN 1001.

Similar Messages

  • How to find out no of customize module pool program in SAP

    Hi All,
    I want to find out number of customize module pool program, Workflow, number of changes made to standard SAP objects (SPAU/SPDD in our SAP system
    Regards
    Sagar

    Join the table with TRDIR to find module-pool program (TRDIR-SUBC = 'M')
    Regards,
    Raymond
    Aravind. R  was faster...
    Edited by: Raymond Giuseppi on Jun 18, 2009 12:56 PM

  • Leaving to Selection Screen in a Module Pool

    hi,
       I have a module pool with a number of screen.Now ifi am on the 4 th screen after i process something i need to go back to the selection screen. Giving leeve to screen 1000 doesnt work.Could neone please tell what command must be written.

    Hello Pankaj,
    U can try like this.
    SET SCREEN 0.
    LEAVE SCREEN
    or
    LEAVE TO SCREEN 0.
    If useful reward.
    Vasanth

  • Number ranges in MM

    Hi Guy,
    Tomorrow we will open new fiscal year in sap so i need to check number ranges setting for MM.
    what is module is related with number ranges in MM ?

    Dear,
    It depands on the type of number series you r maintaining. For Purchasing Documents, u can find reqd settings in spro-img-mm-purchasing-po-define no ranges, Similiarly u can find settings for SA, PIR, PReq, Quota Arrang, RFQ, Quotation, Contract etc. For Material Docts, u can find no ranges in .....mm-Inv mgt and Physical Inv-Number Assignment. Here u can maintain no ranges which may be year/Doc/Transaction/Event type specific.
    For Period opening scenario, u need to crt new series for new year. But generally for MM, it is the calendar year on which u need to crt new series. But it is business specific also. For ex for new fiscal year, u can crt new series for PDocts.
    Regards,
    Sudhanshu

  • PRA Production number ranges

    PRA Production number ranges maintenance is split into 2 options:
    Interval Maintenance For Revenue Accounting Integration Turned ON
    Interval Maintenance For Revenue Accounting Integration Turned OFF
    What is not clear is where to find the integration switch to identify if it is ON or OFF?

    Hi Paulo,
    There will not be any switch that you can see, it is based on the scope of the configuration you determine which interval number range you need to configure for Revenue, for example, if the scope of the project is to include production module and have the number range for revenue defined to integrate, then choose revenue accounting integration turned on and vice versa.

  • Num ranges in module pool prog

    Hi all,
    i want to maintain a  number range for my custom screen.
    whenever i enter data in to the custom screen and press SAVE,it should create a automatic number and tht should b saved in the concern ZTABLE.
    this screen belongs to Production Planning.
    am maintaining this generated number as primary key in the ZTABLE.
    any help will b rewarded with maximum points...
    thanQ

    Hello,
    (a) We need to create number ranges in transaction SNRO
    (b) Enter the number range object name and press CREATE.
    (c) Enter the description, Long text and Number Length domain andWarning %(when you are about to expire the number range a warning must be given eg:if the range is 1 to 100 and 90 is created we need to be notified that 90 is over and only 10 are remaining ..accordingly we should reset the number range or do other necessary actions..eg:10% => when it reaches 90 in number range of 1 to 100 message is displayed)
    enter Number length domain..which is the length of the range eg:if we put "NUM10" as the domain(check in se11->domain->num10) we can declare an interval with 1 to maximum of 9999999999 or less than that according to our requirement
    (d) Press SAVE
    (e)Now click on u201CNumber Rangesu201D button on the application toolbar
    (f) Click on u201CChange Intervalsu201D.
    (g)  Click on u201CInsert Intervalu201D.
    (h) enter the range which needs to be created eg:1 to 100
    Click u201CInsertu201D and then SAVE. The number range object is generated
    in the program we can use the function module, NUMBER_GET_NEXT, to get the next number of any number range object. 
    Also keep in mind that number range NUMBER_GET_NEXT be called on the click of that 'SAVE' button just before updating the Ztable .incase we have any errors in the module pool we need not worry about accidently creating numbers... if the code is wriiten in 'SAVE' action after complete requirement checks the issue will no occur
    Regards
    Byju

  • Function Module for getting Number ranges between two number

    Hi guys,
    Is there any Function module which provide us the number range between two numbers?
    For Ex:If i give 1 and 10 to FM it must give me 1
    2
    3
    4.....upto 10.
    is there any FM for doing this,but i'm not able to find exact Fm for same.
    I can write small piece of code for getting number ranges, but if i get FM it could save little work.

    Hi
    But why do u need a fm, can't you do it by yourself?
    DATA: FROM_NUMBER TYPE I VALUE 1,
          TO_NUMBER   TYPE I VALUE 15.
    DATA: NUMBER            TYPE I.
    DATA: BEGIN OF T_NUMBER OCCURS 0,
                  NR TYPE I,
              END    OF T_NUMBER.
    NUMBER = FROM_NUMBER.
    DO.
      IF NUMBER <= TO_NUMBER.
        T_NUMBER-NR = NUMBER.
        APPEND T_NUMBER.
      ELSE.
        EXIT.
      ENDIF.
      NUMBER = NUMBER + 1.
    ENDDO.
    LOOP AT T_NUMBER.
      WRITE: / T_NUMBER-NR.
    ENDLOOP.
    Max

  • How to save Custom control records through module pool program ?

    Hi guru ,
    1. How to save Custom control records through module pool program ?
    I wrote multiple lines of record in custom control
    Who to save that records ?
    thanking you.
    Regards,
    Subash.

    Hi,
    can refer following code -
    IN PAI , CODE is as follows-
    *&      Form  editor_output
    FORM editor_output .
    NARRATION1 is name of custom controller
      IF v_editor IS INITIAL.
      Create obejct for custom container
        CREATE OBJECT v_custom_container
          EXPORTING
            container_name              = 'NARRATION1'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      Create obejct for the TextEditor control
        CREATE OBJECT v_editor
          EXPORTING
            wordwrap_mode              = cl_gui_textedit=>wordwrap_at_fixed_position
            wordwrap_position          = line_length
            wordwrap_to_linebreak_mode = cl_gui_textedit=>true
            parent                     = v_custom_container
          EXCEPTIONS
            error_cntl_create          = 1
            error_cntl_init            = 2
            error_cntl_link            = 3
            error_dp_create            = 4
            gui_type_not_supported     = 5
            OTHERS                     = 6.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    ENDFORM.                    " editor_output
    getting textdata in internal table as follows
    *&      Form  create_text
    FORM create_text .
      REFRESH : it_texttable,
                it_text.
      IF v_doc_number IS NOT INITIAL.
        IF v_editor IS NOT INITIAL.
          CALL METHOD v_editor->get_text_as_r3table
            IMPORTING
              table                  = it_texttable
            EXCEPTIONS
              error_dp               = 1
              error_cntl_call_method = 2
              error_dp_create        = 3
              potential_data_loss    = 4
              OTHERS                 = 5.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                       WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    Now, our final text data is in internal table it_texttable.
    pls, Reward if found helpful.

  • How to save Custom control records module pool program ?

    Hi guru ,
    1. How to save Custom control records module pool program ?
    I wrote multiple lines of record in custom control
    Who to save that records ?
    thanking you.
    Regards,
    Subash.

    Hi Subasha,
    Please check the format below since it is based on a working code
    **************data declarations
    TYPES: BEGIN OF TY_EDITOR,
    EDIT(254) TYPE C,
    END OF TY_EDITOR.
    data: int_line type table of tline with header line.
    data: gw_thead like thead.
    data: int_table type standard table of ty_editor.
    You should create a text for uniquely identifying the text you are saving each time so that it doesn't get overwritten
    For this a key combination must be decidedd to uniquely identify the test..here it is loc_nam
    ****************fill header..from SO10( t-code )
    GW_THEAD-TDNAME = loc_nam. " unique key for the text
    GW_THEAD-TDID = 'ST'. " Text ID
    GW_THEAD-TDSPRAS = SY-LANGU.
    GW_THEAD-TDOBJECT = 'ZXXX'. "name of the text object created
    *Read Container and get data to int_table
    CALL METHOD EDITOR ->GET_TEXT_AS_R3TABLE
    IMPORTING
    TABLE = int_table
    EXCEPTIONS
    ERROR_DP = 1
    ERROR_CNTL_CALL_METHOD = 2
    ERROR_DP_CREATE = 3
    POTENTIAL_DATA_LOSS = 4
    others = 5.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop data from int_table and save to int_line-tdline appending it.
    *save the text
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
    HEADER = GW_THEAD
    TABLES
    LINES = InT_LINE
    EXCEPTIONS
    ID = 1
    LANGUAGE = 2
    NAME = 3
    OBJECT = 4
    OTHERS = 5.
    IF SY-SUBRC 0.
    ENDIF.
    The code shown above is ok and working fine for save also,hope that the above sample with helps you solve the problem
    Please check and revert,
    Reward if helpful
    Regards
    Byju

  • How to save a varaints in module pool programming

    Hi All,
    How to save a varaints in module pool programming.
    Thanks in Advance.
    GS.

    Hi,
    Forgot my previous reply.
    Just now I checked.
    Create transaction[say.,zzz_test1] using SE93 [choose the option Program and screen] for your module pool program.
    Then use SHDS transaction to create a variant[say zzz_v1] for the transaction you created above.
    Then use SE93 [choose the option Transaction with Variant] to create another transaction zzz_test2 by mentioning the module pool program name and zzz_test1 transaction which you created and zzz_v1 variant which you created.
    Then if you run the transaction ZZZ_test2,then you can see the variant values.
    I created just now all these and it works.
    Hope this is clear.
    If not,get back.

  • Save a variant in a custom module-pool.

    Hi all,
    i hope there is someone that can help me.
    My problem is: i've to save a variant in a module-pool custom SAPMZ...ecc.
    Is there a function module or a routine or some specific ABAP istruction to save a variant?
    I ask this because in my custom module-pool i've insert input field in main dynpro.
    Thanks a lot,
    regards,
    Alex.

    Please use below code it works for me:
    What I did was copy the function group SVAR.  When it asked what function module to copy just select
    'RS_VARIANT_SAVE_FROM_SELSCREEN' and renamed it to 'ZS_VARIANT_SAVE_FROM_SELSCR'.
    DATA: lv_screen LIKE sy-dynnr.
      CLEAR: t_rkey, t_screen.
      REFRESH: t_rkey,  t_screen.
      t_rkey-report = sy-repid.
      APPEND t_rkey.
      t_screen-program   = sy-repid.
      t_screen-dynnr     = '0101'.
      t_screen-type      = 4.
      APPEND t_screen.
      lv_screen = '0101'.
      EXPORT lv_screen TO MEMORY ID 'MZ_COMISSION_REPORT_F02_SCREEN'.
      CALL FUNCTION 'ZS_VARIANT_SAVE_FROM_SELSCR'
        EXPORTING
          curr_report          = sy-repid
          vari_report          = sy-repid
        IMPORTING
          variant              = w_variant
        TABLES
           p_screens           = t_screen
         p_sscr               = t_selctab
         p_vari               = t_vari
        EXCEPTIONS
          illegal_variant_name = 1
          not_authorized       = 2
          no_report            = 3
          report_not_existent  = 4
          report_not_supplied  = 5
          OTHERS               = 6.
      t_rkey-variant = w_variant.
      MODIFY t_rkey INDEX 1.
      CALL FUNCTION 'RS_RWSET_SAVE_VARIANT'
        EXPORTING
          rkey    = t_rkey
        TABLES
          selctab = t_selctab.
    Then in program LZSVARF07 function save_as_variant find where it's transfering the screen.
      READ TABLE variscreens WITH KEY dynnr = sy-dynnr.
      IF sy-subrc NE 0.
        IMPORT lv_screen FROM MEMORY ID 'MZ_COMISSION_REPORT_F02_SCREEN'.
        IF lv_screen IS INITIAL.
          variscreens-dynnr = sy-dynnr.
        ENDIF.
      ENDIF.
      PERFORM fill_varidyn TABLES p_dynsfields
                           USING  $rkey space. "Kein import von DYNSFIELDS
    Good luck!
    Edited by: Alex Nguyen on May 2, 2009 1:36 AM
    Edited by: Alex Nguyen on May 5, 2009 5:26 PM

  • Trigger a workflow from module pool screen at save button

    Hi,
    I am new to workflow.Please help me.My requirement is trigger a custom workflow from module pool screen at save button.
    Scenario is: Create a Z screen for material creation and after pressing save button workflow should trigger to approver and approver emailid should be fetch from Z table and have to provide a link in work flow for Z t-code which displays a report of material pending for approval..
    Please suggest me process how i can acheive this..
    Thanks

    Hi,
    If you're using standard bapi's to save the material, you can then use either the standard events which are already triggered or you coul add a change document for material changes or creation.
    Then this event can be the trigger of your custom workflow.
    Kind regards, Rob Dielemans

  • Module pool save icon

    Hi all,
    i have a module pool program where it's used for creating,modifing a business object. i have a save icon in application tool bar to save the code .
    but the problem here is in the modification part where  i have a table control and the data which is modified is being saved correctly but i have another icon(not in app tool bar) where it's used to delete a particular row in the table control. and when iam saving it, the row is not being deleted from the database table .can anyone help me in this issue.
    PAI
    MODULE USER_COMMAND_0110 INPUT.
      case ok_code.
           when 'DELCON'.
          perform delete_condition_row.
          refresh control 'TAB_COND' from screen '1004'.
      endcase.
    ENDMODULE.                 " USER_COMMAND_0110  INPUT
    FORM delete_join_row .
       DATA L_SELLINE          LIKE SY-STEPL.
       GET CURSOR LINE L_SELLINE.
       DELETE g_TAB_join_itab INDEX L_SELLINE.
    ENDFORM.                    " delete_join_row
    MODULE USER_COMMAND_1000 INPUT.
    case ok_code.
      when 'save'.
          data zgnx_cond_tab type table of zgnx_condition.
          data zgnx_cond_wa type zgnx_condition.
          refresh: zgnx_cond_tab.
          clear: zgnx_cond_wa.
          loop at g_TAB_COND_itab
          into g_TAB_COND_wa.
            move-corresponding g_TAB_COND_wa to zgnx_cond_wa.
            zgnx_cond_wa-obj_name = SCR1000-OBJ_NAME.
            append zgnx_cond_wa to zgnx_cond_tab.
          endloop.
         MODIFY zgnx_condition from table zgnx_cond_tab.
    ENDMODULE.
    This is the code that i have used.

    You have not coded to delete from the db table, only from the internal table.
    FORM delete_join_row .
    DATA L_SELLINE LIKE SY-STEPL.
    GET CURSOR LINE L_SELLINE.
    <b>DELETE g_TAB_join_itab INDEX L_SELLINE.</b>
    ENDFORM. "
    Regards,
    RIch Heilman

  • Is it possible to save a variant in Module Pool program

    Hi,
    We have got a requirement to save a Variant for the user selections in Module Pool Program. Is it possible to save a variant in a Module Pool Program?
    Please let me know how to do that if it is possible.
    Thanks in Advance.

    hi Dagny,
      You can't have variants for module pool. It is possible only for selection screen.
    You have following alternatives :-
    1. Create a report with same selection screen as you have now in module pool.
    And then make a call screen to your intial module pool.
    In this way you can all the advantage of variants as well as module pool.
    OR
    2. Create a transaction variant using transaction SHDO.
    Hope it is helpful.
    and do search the form , it is already answered before.
    regards
    venkat

  • Define Ranges in Module Pool

    Hi,
    i have defined an range in the Module Pool as shown ibelow.
    data :  ar_vbeln TYPE RANGE OF vbak-vbeln,
               ars_vbeln LIKE LINE OF ga_vbeln.
    but how to show this range in the Layout of the Module Pool , i mean the input & Output in the Moduel Pool,
    Can anybody please help me.
    rgds
    Ranjith singh

    hi,
    search it first in SCN... too many posts on this.
    this wiki will help.
    [select option in module pool|http://wiki.sdn.sap.com/wiki/display/ABAP/SELECT-OPTIONSonDialogprogrammingscreen]
    main idea is: create a sub screen in your program and assign it to a sub screen area of your module pool screen in PBO.
    hope this helps

Maybe you are looking for

  • How do I remove entire iTunes library that has duplicated itself in each individual playlist???

    Hi, Further to my previous posting yesterday I have somehow miraculously managed to find and restore my playlist folders (although some of my playlists that I created are missing tracks for some reason - any suggestions???). However, as happy as I am

  • TS - Cannot install specific product from Autodesk suite

    Hi, the scenario is the following: SCCM 2012 R2. All in one server. Windows 2012 R2. Windows 7 Pro x64 (clients) After sccm client installation step, the task sequence successfully install another autodesk products (autocad, inventor, revit) but fail

  • ABC Indicator for Equipment & Functional Location Same or Different

    Hi All, We can find ABC indicators in both Equipment & Functional Location (FL) master data. Q. Please tell me....whether these fields are different for Equipment & FL or same?? Problem is that I could see the same field name ABCKZ for both Equipment

  • What's the point of pre-ordering an album?

    A couple of weeks ago I pre-ordered the Glee Soundtrack Vol. 2 priced @$9.99 It just became available and I got an email advising me I can now download it. When I do, I get a pop-up saying that the final price is now $12.99 not the $9.99 that was dis

  • No Music in Safari will play

    For some odd reason no music in safari will play. When I watch videos.... no sound. And other stuff. But yet when I play music in Itunes it plays music. But in Safari I hear nothing. And it just started happining today. Please Respond! Thanks!