Function module to generate a unique number in report based on descrepency

hi friends,
i have a object that..
Every discrepancy Should Have a unique number in the report, which calls based on the discrepancy (dc_qty)-(recd_qty)=shortage
the shortage value will be always positive,n not <=0..
is there any function module which should generate a unque no
based on passing MBLNR..
or any other way...
Thanks n regards
harish

use following funtion module
call function 'NUMBER_GET_NEXT'
        exporting
          nr_range_nr             = '01'
          object                  = 'ZBDCMSC2N'
        importing
          number                  = file_no
        exceptions
          interval_not_found      = 1
          number_range_not_intern = 2
          object_not_found        = 3
          quantity_is_0           = 4
          quantity_is_not_1       = 5
          interval_overflow       = 6
          buffer_overflow         = 7
          others                  = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
in This
Creat a number Range object(ZBDCMSC2N') using transction SNRO.
for any problem revert back.
regards
Rajesh

Similar Messages

  • Function module to generate Batch number

    Can anyone please let me know, the function module to generate the batch numbers. if possible the procedure to generate the batch number.

    Hi Venkat,
    Check function module <b>VB_CREATE_BATCH</b>.
    Thanks,
    Vinay

  • Function Module for generating Randon Numbers

    Hi,
    Is there any Function Module to generate Random Numbers automatically.
    Say for example: The Lower Limit is 10 and the Higher imit is 30.
    So is should generete the random numbers between 10 and 30. and it should store in he Data Base level.
    Please help me in this ascept.
    Thanks & Regards:
    JSR

    Hi,
    You can use Number Range Concept.
    Get new number
    CALL FUNCTION 'NUMBER_GET_NEXT'
          EXPORTING
               nr_range_nr             = c_01
               object                  = c_key_no
          IMPORTING
               number                  = pw_key_no
          EXCEPTIONS
               interval_not_found      = 1
               number_range_not_intern = 2
               object_not_found        = 3
               quantity_is_0           = 4
               quantity_is_not_1       = 5
               interval_overflow       = 6
               buffer_overflow         = 7
               OTHERS                  = 8.
    Thanks,
    Sree.

  • Generate an unique number without sequence

    Hello,
    I need generate an unique number without sequence. I am using Oracle 11.2, here is the details. The column idSeq is unique withing one specific idType. I don't want a sequence for each idType.
    create table tb_test (idSeq number(5), idType number(5), addr varchar2(256));
    insert into tb_test
    (select case when idSeq is null then 1 else max(idSeq)+1 end, 3, 'Main street');
    I am having ORA-00937 : not a single-group group function error, any suggestion?
    Edited by: 939569 on 13-Feb-2013 11:21 AM

    Hi,
    939569 wrote:
    Hello,
    I need generate an unique number without sequence. Explain what you're trying to do, and why a sequence won't do it.
    I am using Oracle 11.2, here is the details. The column idSeq is unique withing one specific idType. I don't want a sequence for each idType.
    create table tb_test (idSeq number(5), idType number(5), addr varchar2(256));
    insert into tb_test
    (select case when idSeq is null then 1 else max(idSeq)+1 end, 3, 'Main street');
    I am having ORA-00937 : not a single-group group function error,Right. Since the sub-query is using an aggregate function (MAX), everything in the SELECT clause must be an aggregate, a group by expression, a constant, or something that depends entirely on them. In this example, the CASE expression depends on idSeq, which is not an aggregate, not a group by expression (there is no GROUP BY clause) and not a constant.
    Also, the sub-query must have a FROM clause. All queries and sub-queries in Oracle require a FROM clause.
    any suggestion?Use a sequence. The numbers won't be consecutive within each idType, but what does that matter? Chances are, no matter what you do, you won't be able to maintain consecutive numbers within each idType anyway.
    If you won't use a sequence, then you can try:
    INSERT INTO  tb_test (idSeq, idType, addr)
    SELECT  1 + NVL ( MAX (id_seq)
                  , 0
    ,       3
    ,     'Main street;
    FROM     tb_test
    WHERE   idType  = 3
    ;

  • IDoc outbound function module to generate Purchase order PORDCH IDoc

    Hi all,
    Can anyone help me with the outbound function module to generate PORDCH IDoc

    instead of that you can use the Below For PO's.
    Message Type : ORDCHG
    Process Code  : ME11
    Function : IDOC_OUTPUT_ORDCHG

  • Function Modul for generate hashcode

    Hi all
    i search a function modul for generate a hashcode. Does it existing a function modul for that?
    Regards

    Hi
    Try FKK_BR_BUILD_HASH_CODE.
    Pushpraj

  • Function modules to generate the event required

    Hi guys,
    I have created a workflow but its start event is not getting triggered though condition data is correct.
    I want to debug and see when the Business object's event is called.
    Can you please tell me name of the Function modules to generate the event. This way i'll put a breakpoint on those and check the flow ?
    Regards,
    Shaili

    Thanks Surjith
    I'll check this FM.
    Also I want you advice on the real issue i'm facing.
    I have created a workflow giving some condition with start event as CHANGED of BUS1006. Now the work of populating the field in condition is done automatically by a BADI i've created.
    The issue is that the workflow is not triggerd during automatic population of teh field but is triggered when i explicitly populate the field.
    The reason might be that CHANGED event of the business object used is triggered before the SAVE BADI has populated teh field. So CHANGED event 's condition is not satisfied before the BADI has finished updating.
    Is there a way tackle this. Can I somehow push back the trigger of workflow...I'm new to workflows so please don't mind if this sounds foolish
    Regards,
    Shaili

  • Is there any function module that generates date of 30th september of next

    is there any function module that generates date of 30th september of next year.?

    May be u mean...20100930
    You can simply
    Add 10000 to this years sept 30...If you want sept 30 from today...
    Data: G_DATE Type Sy-DATUM.
    G_DATE = Sy-DATUM.
    G_DATE+4(02) = '09'.
    G_DATE+6(02) = '30'.
    G_DATE0(04) = G_DATE0(04) + 1.
    Santhosh

  • Generate spool req number for report output list

    Hi,
    How to generate spool request number for report output list while executing the report.Please provide if you have any sample code.
    Thanks and Regards,
    BSR.

    HI srinivas,
    welcome to sdn.
    Exporting the Contents of a Spool Request
    Use
    You want to export the content of a spool request in one of the following ways:
    ·        As a text file to the SAP GUI working directory
    ·        Unconverted or as a table, RTF, or HTML to a directory of your choice
    ·        As a PDF file to a directory of your choice
    Procedure
    Follow the procedure below:
    Exporting to the SAP GUI Working Directory
    If you are exporting large quantities of data, downloading the spool request as a text file to the SAP GUI working directory is a good solution.
    Choose Spool Request ® Forward® Export as Text.
    The entire text is stored in your SAP GUI working directory in ASCII format.
    A file of this type is named using the following pattern:
    .txt
    Example: ABC0000004327.txt
    You require appropriate authorization for this function from your administrator.
    Exporting Unconverted or as a table, RTF, or HTML to a Directory of Your Choice
    With this method of exporting a spool request, the content of the spool request is first displayed, and you then download the content in the format of your choice to a directory of your choice.
           1.      Select the spool request to be exported and choose  Display Contents.
           2.      In the case of SAPscript/Smart Forms documents, activate list display by choosing Goto.
           3.      Choose System ® List ® Save ® Local File.
           4.      Choose one of the available formats and confirm your choice.
           5.      Choose a directory and save the spool request.
    By default, only the first 10 pages of a spool request are saved in a file. You can increase the number of pages to be saved by choosing Goto ® Display Requests ® Settings and making the desired entries in the Display Area group box.
    Exporting as a PDF File
    You want to export the contents of a spool request as a PDF file to a directory of your choice, and print the file as required. The PDF file contains the print data in the format in which it would be output by the printer.
    The following procedure is irrelevant for the printing of PDF-based forms, since a PDF file is already returned with this method. See also Displaying and Printing PDF-Based Forms.
    You also require authorization from your administrator to run this report.
    The PDF file is generated as follows with report RSTXPDFT4:
           1.      Generate a spool request from the document to be printed.
           2.      In transaction SE38, start report rstxpdft4.
           3.      In the displayed window, enter the spool request number and the directory in which the PDF file is to be stored.
    Leave the Download PDF File option selected.
    Choose  Execute.
           4.      In the next window, you can confirm or change the path in which the file is be stored.
    Save your entries.
           5.      The system displays a log from which you can see whether the report was successfully performed.
    You can then open the file from the directory and print it as required.
    Restrictions for Exporting as a PDF File
    ·        The PDF conversion only supports true bar codes for Smart Forms, which were generated with the new bar code technology as of SAP NetWeaver 04. In all other cases, the bar code is only simulated.
    ·        PDF conversion, especially of ABAP lists, is slower and is therefore not suitable for mass printing. However, you can speed up the conversion to PDF using the FASTLISTCONV option in report RSTXPDF3.
    ·        The font selection for ABAP lists is predefined in the PDF converter and cannot be changed.
    For more information about constraints, see SAP Note 323736 in the SAP Service Marketplace
    see this links
    http://help.sap.com/saphelp_40b/helpdata/en/d9/4a98f351ea11d189570000e829fbbd/content.htm
    http://web.mit.edu/SAPR3/docs/webdocs/reports/rpRFprint.html
    regards
    shankar
    reward me if usefull

  • Function Module to Generate Outbound IDOC for Sales Documents

    Hello Experts,
    Can someone please help me, I need to know which function module to use in order to generate the outbound IDOC for sales documents.  Some of the fm's I have come across are the following:
    IDOC_OUTPUT_ORDERS, but actually for Purchase Orders
    IDOC_OUTPUT_ORDRSP, but did not generate any IDocs for my sample Sales Order.
    Points will be given for any help provided.
    Thanks in advance.

    Hi Nagaraj,
    I tried using the IDOC_OUTPUT_ORDERS but I keep getting an error that the Purchase Order <xxx> does not exist, even though the document I tried is a sales order.  For everyone's reference here is the code:
    form process_data.
      DATA v_idoc       TYPE edidc-docnum.
      DATA i_edidd      TYPE TABLE OF edidd.
      DATA wa_idoc_ctrl TYPE edidc.
      LOOP AT i_nast INTO wa_nast.
        CLEAR i_msgs[].
        CALL FUNCTION 'WFMC_PROTOCOL_GET'
          EXPORTING
            cps_nast        = wa_nast
          tables
            messages        = i_msgs
         EXCEPTIONS
           NOT_FOUND       = 1
           OTHERS          = 2.
        LOOP AT i_msgs INTO wa_msgs WHERE arbgb EQ 'E0'.
    *--- Check first if there is an IDOC
          IF wa_msgs-msgv1 IS INITIAL.
            CONTINUE.
          ENDIF.
          v_idoc = wa_msgs-msgv1.
          CLEAR i_edidd[].
          CLEAR wa_idoc_ctrl.
          CALL FUNCTION 'IDOC_READ_COMPLETELY'
            EXPORTING
              document_number                = v_idoc
            IMPORTING
              IDOC_CONTROL                   = wa_idoc_ctrl
    *         NUMBER_OF_DATA_RECORDS         =
    *         NUMBER_OF_STATUS_RECORDS       =
            TABLES
    *         INT_EDIDS                      =
              INT_EDIDD                      = i_edidd
            EXCEPTIONS
    *         DOCUMENT_NOT_EXIST             = 1
    *         DOCUMENT_NUMBER_INVALID        = 2
              OTHERS                         = 3.
          CALL FUNCTION 'IDOC_OUTPUT_ORDERS'
            EXPORTING
              object                              = wa_nast
              control_record_in                   = wa_idoc_ctrl
    *       IMPORTING
    *         OBJECT_TYPE                         =
    *         CONTROL_RECORD_OUT                  =
            tables
              int_edidd                           = i_edidd
    *       EXCEPTIONS
    *         ERROR_MESSAGE_RECEIVED              = 1
    *         DATA_NOT_RELEVANT_FOR_SENDING       = 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.
          COMMIT WORK.
        ENDLOOP.
      ENDLOOP.

  • Function module to retrieve the account number linked to an SD invoice item

    Hi all,
    I should retrieve the gl account number linked to a certain SD invoice item. The
    program starts from VBRK and VBRP data. Is there a function module which
    enables to get it starting from these header lines? I already used the function
    module: RV_INVOICE_ACCOUNT_DETERM ( release: 4.0 ), but in some cases it
    doesn't seem to function properly ( the export table TKOMV doesn't contain a
    value for the SAKN1 field ). For the invoices for which the function isn't able to
    retrieve the account number, the standard accounting analysis functionality returns
    the following message: account determination carried out via KOFI type. So I'm
    searching for a function module that's able to retrieve the account number in these
    cases also.
    Thanks in advance.
    Adriano.

    Dear Adriano,
    Try with Function Module 'SD_DETERMINE_ACCOUNT_INVOICE '.
    Additional Info:
    BAPIs related salesorder:
    BAPI_SALESORDER_CHANGE Sales order: Change Sales Order
    BAPI_SALESORDER_CONFIRMDELVRY Sales Order: Confirmation of Delivery; Document Flow Update
    BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More Maintenance
    BAPI_SALESORDER_GETLIST Sales order: List of all Orders for Customer
    BAPI_SALESORDER_GETSTATUS Sales Order: Display Status
    BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
    FM:
    MB_ADD_PURCHASE_ORDER_QUANTITY (Reading and adding open purchase order quantities)
    SD_SALES_ORDER_STATUS_WWW for complete details including the delivery information.
    Hope this will help.
    Regards,
    Naveen.

  • SmartForm Function Module not generated in Production

    Hi
    I have a smartform in DEV(Box A). It works fine. I trasnsported it to PROD(Box B). It appears as Active state in PROD. But there is no Function module generated for this smartform. As a result my program dumps in PROD.
    I am running it on 4.6C Release.
    Any suggestions ?
    Murali.

    Hi again,
    1.  I dont find any Function Module name under ENVIRONMENT -
    > FUNCTION MODULE NAME
    Click on
    FUNCTION MODULE NAME
    and it will give a pop-up window
    displaying the FM name.
    2. If its not there,
       then u can do 3 things :
      a) in prd server, activate the smart form again.
       (this will generate the FM)
      b) try to transport a new request,
        for the same smartform.
      c) ask basis team to check the LOG
        of this transport request.
      (whether any error / warning was there in the
       transport log)
       From this log, if any warning/error is there,
       then we can come to know, that there is some problem.
    regards,
    amit m.

  • BAPI function module to get condition type and its values based on delivery number?

    Hi All,
    I would like to have the BAPI function module to get condition type value based on delivery number before invoice is created.please provide detail program for as a reference .please reply as soon as possible its urgent.
    Regards,
    saaikumar.

    If you haven't already, you may first need to search via the SAP transaction "BAPI" in the area this is applicable to.  Failing that I do hope you get an answer.

  • Function module to get material serial number status

    Hi Gurus,
    How to get get material serial number status? Is there any function module?
    TCode IQ03 to display the serial number staus, but where i can find the status (AVLB / ESTO / ECUS) of these serial number ?
    Pls help.
    Regards,
    Sankaran

    hi,
    SELECT SINGLE  equnr objnr FROM
                               equi INTO (equnr1 , objnr1)
                               WHERE sernr = wa_final-sernr
                                 AND matnr = wa_final-matnr.
        CALL FUNCTION 'STATUS_TEXT_EDIT'
          EXPORTING
            client           = sy-mandt
            flg_user_stat    = 'X'
            objnr            = objnr1
            spras            = sy-langu
            bypass_buffer    = 'X'
          IMPORTING
            line             = sttxt
          EXCEPTIONS
            object_not_found = 1
            OTHERS           = 2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Regards
    siva

  • Function Module to get Material Document Number

    Hi All,
    I want to get the Material Document Number based on the Material, batch ,movement type and plant. Is there any function module to achieve this, without going to MSEG table.

    check this might help you..
    Get Material Document Number and Material Document Year
    Regards
    Kumar

Maybe you are looking for

  • Restrict GR date prior to PO creation date.

    Dear experts, The Present configuration allows GR date prior to PO creation date. The system allows users to post Goods receipt (MIGO), even if the GR date is prior to the PO creation date. How to restrict this? Is there a standard customization in M

  • Help with OS 10.6.8 and photoshop CS2

    My mac OS systm is OS 10.6.8. My photoshop from CS2 just expired and I can not reinstall without authenicate number. I wanted to purchase photoshop CS5. Can not find a place to buy it. I can not get the latest as my imac is about 6 years old. I can u

  • Download Failure of iTunes software

    Had to uninstall iTunes due to Runtime error R6034. Now cannot download the software. Logged in to Apple/iTunes, clicked Download, but does not arrive on my PC. Any suggestions?

  • Exchange Server 2010 SP3 Windows Installer

    Does anyone know when Exchange 2010 SP3 installation will be compatible with the Windows Installer 5.0? HossFly, Exchange Administrator

  • Pipeline Steps and JCo Calls

    Hi All, I wanted a few links which can provide me with indepth knowledge of these two points 1. Pipeline Steps in XI 2. JCo Calls during processing of messages I am looking specifically to understand the message processing in steps where the Mapping