Update of the Logistics infomation structures

Hi
Pls let me know the step-by-step procedure to update the infomation structures S031 and S032.
Thanks
Maruthi

Hi
Let me detail you about my question.
I have a material ******* with a MRP controller say 001 in the material master.
I have posted stock of 20,000 EA to that material.
I look for the stock in MMBE and find it in that particular Pland and Storage location.
I run MC.9 with selection parameters as material and MRP controller 001.
I find the same stock that is 20,000 EA.
But now i change the MRP controller to say 002, in material master for the same material.
I posted stock of 10,000 EA to the material.
I look for the stock in MMBE, and thus it shows the full amount 30,000 EA
I run MC.9 with selection parameters as material and MRP controller as 002.
The full stock is shown 30,000 EA. but negative value in dollars
The main problem now is:
1. When i run MC.9 with material and previous MRP controller 001
Stock is shown as ZERO qty and with wrong value in dollars.
2. But when i run MC.9 with material only, I get the correct values in both quantity and value.
Now my main question is
1. Why are the negative stock values are shown( in dollars).
2. Why is there a deviation in figures when we run MC.9
3. Information is pulled from infostructure S031. Is S031 having wrong data in it ? If so how to update the infostructure S031 to the correct values.
Thanks
Maruthi Ram

Similar Messages

  • Custom Update of the Logistics Execution status on the FO header

    Hi,
    in our project, we are using an app to update the statuses of the Freight Units. On the Fo, we are updating departure, arrival, load and unload.
    In standard, the logistical execution status has the last event on the header. Thats useful when you look at the standard freight order lists.
    In some cases, the Logistical execution status is not updated liek we would expect it, thus we would like to update it in our own way. But, where is the field? Could not find it in the BOPF Framework on the TOR object ROOT. Has anyone done this before? Is there an Action for this?

    Hi Petra,
    you did not find the field, because there is none
    The logistical execution status is determined on the fly. This is done in method GET_LOGISTICAL_CURRENT_STOP of class /SCMTMS/CL_TOR_HELPER_STATUS. There you could implement own logic in e.g. post enhancement.
    Best regards, Daniel

  • Goods issue not updating in teh standard SAP structures -reg

    Hi,
    I have three questions to get your support
    1. For repetitive manufacturing GR is updated in the SAP standard structure S225 and GI in S226
       Like this in discrete where GR and GI happen with reference to production order ,where the data is
       updated ?
    2. I have done GI 261 movement for a production order and document got posted
        But i am not getting this in any of the below transactions
       MCP1
       MCP5
       MCRE
       MCP3
       MCRI
      What could be the reason ? i have checked in posted document also where it showing 261 movement 
      details
    3. further using COIB i have linked the serial numbers of BOM header and BOM component and saved
       next time when i go to COIB how to see the earlier assigned serial numbers details
       for report purpose which tables and fields are to be used
       once i assign serail numbers next time where can i go and see that
    expecting positive inputs from all you friends .....
    regards,
    madhu kiran

    mark as answered

  • Set type creation and updation of the structure COMT_PROD_MAT_MAINTAIN_API

    Hello Experts,
    I've the below scenario,
    I created new Org dependent Z set type and assigned to a category.
    And I'm using the API - COM_PRODUCT_GETDETAIL_API to get the details about the material via the export parameter ES_MATERIAL_DATA which has the structure of COMT_PROD_MAT_MAINTAIN_API.
    My doubt :
    Whether the newly created Z set type structure will be automatically updated to this COMT_PROD_MAT_MAINTAIN_API? (In my case it has not happened)
    I hope system has to append this structure automatically.
    If not how to get this job done. Is there any settings to be done?
    If not Whether I can append this structure manually? will it affect anywhere?
    Kindly help me on this regard.
    Thanks in Advance!
    Regards,
    Senthil.

    Also Senthil,
    I am pasting some sample code for your help. this should solve your issue
    Also make sure the set type structures are appened in COM PRODUCT MAINTAIN API Structure else the updation logic doesn't work.
    DATA:         ls_detail1          TYPE zmsr_detail_maintain,
            gs_set_typ      TYPE comt_prod_mat_maintain_api,
           gt_product_api       TYPE comt_product_maintain_api_tab,
            gs_product_api  TYPE comt_product_maintain_api,
            gs_text1        TYPE comt_prlgtext_maintain,
        fill the new comm_product
        gs_product_api-com_product-product_guid = g_product_guid.
        gs_product_api-com_product-product_type  = c_product_type.
        gs_product_api-com_product-logsys        = g_logsys.
        gs_product_api-com_product-valid_from    = g_valid_from.
        gs_product_api-com_product-valid_to      = g_valid_to.
        gs_product_api-categories                = gt_categories.
        gs_text1-data-stxh-mandt         = sy-mandt.
        gs_text1-data-stxh-tdobject      = c_product.                            "'PRODUCT'.
        gs_text1-data-stxh-tdid          = c_base.                               "'BASE'.
        gs_text1-data-stxh-tdspras       = c_en.                                 "'EN'.
        ls_line-tdline                   = gs_upload1-lg_text.
        APPEND ls_line TO lt_lines.
        CLEAR ls_line.
        ls_longtxt-lines    = lt_lines.
        gs_text1-data-lines = ls_longtxt-lines.
        APPEND gs_text1 TO gs_product_api-long_texts.
        gs_text-data-langu      = c_en.                                          "'EN'.
        gs_text-data-short_text = gs_upload1-msr_desc.
        gs_text-data-valid_from = g_valid_from.
        gs_text-data-valid_to   = g_valid_to.
        gs_text-data-logsys     = g_logsys.
        APPEND gs_text TO gs_product_api-short_texts.
        CLEAR gs_text.
        APPEND gs_product_api TO gt_product_api.
          ls_detail1-data-zz0010       = gs_upload1-zz0010_1.
          ls_detail1-data-zz0011       = gs_upload1-zz0011_1.
          ls_detail1-data-zz0012       = gs_upload1-zz0012_1.
          ls_detail1-data-zz0013       = gs_upload1-zz0013_1.
          ls_detail1-data-zz0014       = gs_upload1-zz0014_1.
          ls_detail1-data-zz0015       = gs_upload1-zz0015_1.
          ls_detail1-data-zz0016       = gs_upload1-zz0016_1.
          ls_detail1-data-zz0017       = gs_upload1-zz0017_1.
          ls_detail1-data-zz0018       = gs_upload1-zz0018_1.
          ls_detail1-data-zz0019       = gs_upload1-zz0019_1.
          ls_detail1-data-zz0020       = gs_upload1-zz0020_1.
          ls_detail1-data-zz0021       = gs_upload1-zz0021_1.
          ls_detail1-data-zz0022       = gs_upload1-zfil_nbr.
          ls_detail1-data-product_guid = g_product_guid.
          ls_detail1-data-logsys       = g_logsys.
          ls_detail1-data-valid_from   = g_valid_from.
          ls_detail1-data-valid_to     = g_valid_to.
          APPEND ls_detail1 TO gs_set_typ-zmsr_detail.
          CLEAR ls_detail1.
          APPEND gs_set_typ  TO gt_set_typ.
          CLEAR gs_set_typ.
          CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
            EXPORTING
              i_datlo     = sy-datum
              i_timlo     = sy-uzeit
            IMPORTING
              e_timestamp = g_valid_from.
          APPEND gs_set_typ  TO gt_set_typ.
          CLEAR gs_set_typ.
    *-------Mainten. Functions for Materials
          CALL FUNCTION 'COM_PROD_MATERIAL_MAINTAIN_API'
            EXPORTING
              it_product      = gt_product_api
              it_set          = gt_set_typ
              iv_commit_work  = 'X'
              iv_update_task  = 'X'
              iv_enqueue_mode = 'E'
            IMPORTING
              et_bapireturn   = gt_bapireturn.
          IF sy-subrc = 0.
          Commit the BAPI
            COMMIT WORK .
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    HOpe this helps !!!!!

  • 10.5.8 update corrupted the Volume Structure of my MacBook Pro and iMac

    After installing the 10.5.8 update on my Macbook Pro AND my iMac, BOTH computers refuse to boot up. If I boot from a TechTool Deluxe DVD and run the system scan, It fails both the Directory Scan and the Volume Structure test. The only common application on these computers is the Fusion PC emulator. I was reading that the newest update fixed problems with this application. PLEASE HELP!!!

    Some general advice on updating:
    It is worth noting that it is an extreme rarity for updates to cause upsets to your system, as they have all been extensively beta-tested, but they may well reveal pre-existing ones, particularly those of which you may have been unaware. If you are actually aware of any glitches, make sure they are fixed before proceeding further.
    So before you do anything else:
    If you can, make a full backup first to an external hard disk. Ideally you should always have a bootable clone of your system that enables you to revert to the previous pre-update state.
    Turn off sleep mode for both screen and hard disk.
    Disconnect all peripherals except your keyboard and mouse.
    1. Repair Permissions (in Disk Utility)
    2. Verify the state of your hard disk using Disk Utility. If any faults are reported, restart from your install disk (holding down the C key), go to Disk Utility, and repair your startup disk. Restart again to get back to your startup disk.
    At least you can now be reasonably certain that your system does not contain any obvious faults that might cause an update/upgrade to fail.
    3. Download the correct version of the COMBO update from the Apple download site.
    The Combo updater of Leopard 10.5.8 can be found here:
    http://support.apple.com/downloads/MacOS_X_10_5_8_ComboUpdate
    If you prefer to download updates via Software Update in the Apple menu (which would ensure that the correct version for your Mac was being downloaded), it is not recommended to allow SU to install major (or even minor) updates automatically. Set Software Update to just download the updater without immediately installing it. There is always the possibility that the combined download and install (which can be a lengthy process) might be interrupted by a power outage or your cat walking across the keyboard, and an interrupted install will almost certainly cause havoc. Once it is downloaded, you can install at a time that suits you. You should make a backup copy of the updater on a CD in case you ever need a reinstall.
    Full details about the 10.5.8 update here: http://support.apple.com/kb/HT3606
    More information on using Software Updater here:
    http://support.apple.com/kb/TA24901?viewlocale=en_US
    Using the Combo updater ensures that all system files changed since the original 10.5.0 are included, and any that may have been missed out or subsequently damaged will be repaired. The Delta updater, although a temptingly smaller download, only takes you from the previous version to the new one, i.e. for example from 10.5.7 to 10.5.8. Software Update will generally download the Delta updater only. The preferable Combo updater needs to be downloaded from Apple's download site.
    Now proceed as follows:
    4. Close all applications and turn off energy saving and screensaver.
    5. Unplug all peripherals except your keyboard and mouse.
    6. Install the update/upgrade. Do not under any circumstances interrupt this procedure. Do not do anything else on your computer while it is installing. Be patient.
    7. When it ask for a restart to complete the installation, click restart. This can take longer than normal, there are probably thousands of files to overwrite and place in the correct location. Do nothing while this is going on.
    8. Once your Mac is awake, repair permissions again, and you should be good to go!
    If your Mac seems slightly sluggish or ‘different’, perform a second restart. It can’t hurt and is sometimes efficacious!
    9. Open a few of your most used applications and check that all is OK. In this connection please remember that not all manufacturers of third party applications and plug-ins, add-ons, haxies etc, will have had time to do any necessary rewrites to their software to make them compliant with the latest version of your operating system. Give them a weeks or two while you regularly check their websites for updates. This applies particularly to plug-ins for Safari 4.
    N.B. Do not attempt to install two different updates at the same time as each may have different routines and requirements. Follow the above recommendations for each update in turn.
    Lastly, Apple's own article on the subject of Software Update may also be useful reading:
    http://docs.info.apple.com/article.html?artnum=106695
    If you are updating Safari (or just have):
    Input Managers from third parties can do as much harm as good. They use a security loophole to reach right into your applications' code and change that code as the application starts up. If you have installed an OS update and Safari is crashing, the very first thing to do is clear out your InputManagers folders (both in your own Library and in the top-level /Library), log out and log back in, and try again.
    So, disable all third party add-ons before updating Safari, as they may not have been updated yet for the new version. Add them back one by one. If something goes awry, remove it again and check on the software manufacturer's website for news of an update to match your version of Safari.
    Most errors reported here after an update are due to an unrepaired or undetected inherent fault in the system, and/or a third party add-on.
    Additional tips on software installation here:
    http://docs.info.apple.com/article.html?artnum=106692
    To reiterate, Input Managers reach right into an application and alter its code. This puts the behavior of the affected application outside the control and responsibility of its developers: a recipe for problems. That's not to say that issues absolutely will ensue as a result of Input Managers, but you, as a user, must decide. If the functionality of a specific Input Manager or set thereof is really important to you, you may well choose to assume the associated risk.
    Again, the advice is to remove all Input Managers from the following directories:
    • /Library/InputManagers
    • ~/Library/InputManagers
    especially prior to system updates (they can always be added back one-by-one later).

  • How to Update line items in a structure ?

    Hi i am getting 3 line items retrieved from a Function Module. But while displaying in the script it shows only the last line item. How do i update all the line items??
    The code is given below,
        CALL FUNCTION 'FI_PRINT_ZTERM'
             EXPORTING
                  I_ZTERM         = EKKO-ZTERM
                  I_LANGU         = EKKO-SPRAS
                  I_XT052U        = ' '
                  I_T052          = T052
             TABLES
                  T_ZTEXT         = ZBTXT
             EXCEPTIONS
                  ZTERM_NOT_FOUND = 01.
    Loop at ZBTXT.
        READ TABLE ZBTXT.
        IF SY-SUBRC EQ 0.
          PEKKO-ZBTXT = ZBTXT-LINE.
          DELETE ZBTXT INDEX 1.
    *      UPDATE PEKKO-ZBTXT.
        MOVE ZBTXT-LINE TO PEKKO-ZBTXT.
        ENDIF.
    ENDLOOP.
    And also how do i retrieve it in the script ?

    HI Navaneethan,
    please try following code.
    make  PEKKO should be internal table with appropraite structure..
    Loop at ZBTXT.
          MOVE ZBTXT-LINE TO PEKKO-ZBTXT.
          append  PEKKO.
         clear  PEKKO.
    ENDLOOP.
    loop at pekko.
    write : / PEKKO-zbtxt.
    endloop.
    if above code is helpful, REWARD POINTS.
    Regards,
    Ranjith

  • Update of the field earliest/latest possible activity (AFVC-FRSP)

    Hello Abaplers,
    is their a solution for updating the field FRSP of the AFVC table, out of a report, without updating it directly via OpenSQL?.
    Actually i use the BAPI: BAPI_NETWORK_MAINTAIN.
    But it seems to be that the bapi has no entry in the corresponding
    structure I_ACTIVITY for the FRSP field of the AFVC table.
    I searched for different function modules for updating the field seperatly,
    but with no result.
    I will appreciate your help.
    Many thanks in advance.
    Alexander

    thanks for your answer, i know but i think it`s usally not the way which SAP recommend.
    I want to avoid it because of the risks in some cases (FK-Field updates, changeable masterdata -> inconsistency, bypassing the checks of the data element etc.).
    But it seems to be that there is no other way (bapi, fm etc) and the direct update is the one and only method for updating the field?

  • Will there come a software update for the "older" ipods?

    Hi all, will there come a software (firmware?) update for the new menu of the Ipod Video?
    I have an Ipod video 60Gb and I'm really happy with it, but I found out that the newest ipods have some extra functionality in menu structure, which enhances the search.
    Thanks for your answers!
    Jean Loyens
    Belgium
    intell   Windows XP Pro  

    Thank you for your answer.
    Well, they might not have had the possibility then...
    Maybe it's just one of those features that were invented later...
    My wife has an Ipod Mini and it has less menu possibilities than my ipod video...
    I have posted the request, but as stated it will be very unlikely that they will answer the request.
    Thanks anyway, ipod is really the best!
    Best regards, Jean Loyens, Belgium
    Unlikely. If Apple had wanted this feature for older
    iPod videos, they would've implemented it in the last
    update.
    However anything is possible so if you want it,
    suggest it to Apple here.
    iPod
    Feedback.
    Th

  • No condition update from the sales orders exist - VK322 Message

    Hello All,
    I have activated " Condition Index" & " Condition Update" flag for one of my discount condition type and then created it's condition record along with scales on three levels. The condition type which I mentioned above is set as " Value Scale" in Scale Basis for checking the document value and apply the applicable discount percentage.
    I have created three sales orders wherein the discount percentage is getting applied as per my condition record ( so, the document value is getting accumulated and compared with the condition record correctly )  but when I try to check the cumulative values ( ctrl +shift + F4 ) from the condition record, I get information message " VK322" mentioned in the subject.
    VK322 -
    No condition update from the sales orders exist
    Message no. VK322
    Diagnosis
    The following causes are possible:
    1. There are no sales orders for the condition record that you selected.
    2. Updating condition records in the sales order entry is not active.
    Procedure
    Concerning 1:
    Check the sales orders created for the condition record that you selected.
    Concerning 2:
    Activate the updating for condition records in the sales order entry.
    I have checked everything in SPRO for this but could not find anything which can give me a clue to resolve this problem, especially " Concerning 2" part of this message.
    My requirement > To be able to see the cumulative values from condition record.
    Also, in which table the accumulated values get stored?
    Appreciate your expert advise on this issue.
    Regards,
    Hrishi
    Edited by: Hrishikesh Bhalwankar on Sep 13, 2011 1:59 AM

    Hello Everyone,
    I would like to thank each one of you for giving valuable inputs in regard to my requirement and I would like to let you know that I am able to achieve the results as per the expectation.
    I would also like to share some key things which I did ( with the help of all your expert inputs ) due to which the requirement is met:-
    1. Activation of ' Condition Index, Condition Update' in V/06 for the discount condition type.
    2. Maintained ' B - Value Scale' in Scale Basis for the said condition type in V/06 - my requirement was to check against a value to apply the necessary scale base percentage.
    3. Activation of ' S071' info structure via OM01
    4. Condition record maintenance as per the required scales.
    4. Written a new routine to check the accumulated condition base value from S071 along with the current document condition base value.
    5. Put this routine in ' Scale Formula' in V/06.
    This is giving me the perfect results for the correct application of the discount.
    Just last question - How to re-organize the S071 info structure as I tried to re-organize it with Standard Program ' RV15F001' but it is not re-organizing this info structure... Any idea on this?
    Thanks a lot friends for all your advice...
    Regards,
    Hrishi
    Edited by: Hrishikesh Bhalwankar on Oct 11, 2011 2:11 AM

  • Folio number not updated in the table RG23D

    Hi all,
    Folio number not updated in the table RG23D when I create depot excise invoice using batch program J_1IJCHK. Can any one help me by providing rootcause and solution.
    Thanks in advance.
    Regards
    Balaji

    See can i know in which version u r working,Because if u r in 4.6c there will be some problem.Some patches will be there.
    Try this program i have send and assign excise duty
    REPORT YJ_1IJCHK MESSAGE-ID 8I.
    TABLES :  J_1IEXCHDR,                  "excise header
              J_1IEXCDTL,                  "excise detail
              J_1IRG23D ,                  "RG23D register
              J_1IWRKCUS,                  "Plant level customisation
              J_1IREGSET,                  "register set customisation
              J_1IEXCDEF,                  "Tax default information
              VBFA,                        "sales document flow
              LIKP,                        "delivery header
              LIPS,                        "delivery detail
              T005,                        "country information
              KUAGV,                       "sold-to-party information
              KUWEV,                       "ship-to-party information
              KNA1,                        "customer master
              VBPA,                        "sales document partner
              TVKO,                        "sales organisation to company co
              VBUK,                        "delivery information
              MAKT,                        "material description
              T001.                        "company code
    selection-screen begin of block delivery_details no intervals.
    PARAMETERS: FCODE    TYPE C,
                DELIVERY LIKE LIPS-VBELN,
                EXCGROUP LIKE J_1IEXCHDR-EXGRP,
                SERGROUP LIKE J_1IEXCHDR-SRGRP.
    TYPES : BEGIN OF RG23D.
            INCLUDE STRUCTURE J_1IRG23D.
    TYPES:  MENGR LIKE J_1IEXCDTL-MENGR,           "remaining quantity
            MENGA LIKE J_1IEXCDTL-MENGA,           "quantity actually rec
            ADDBED LIKE J_1IEXCDTL-ADDBED,
            ADDSED LIKE J_1IEXCDTL-ADDSED,
            ADDAED LIKE J_1IEXCDTL-ADDAED,
            END OF RG23D.
    DATA : BEGIN OF J1IJ300,
            BUKRS   LIKE TVKO-BUKRS,
            WERKS   LIKE LIPS-WERKS,
            REGID   LIKE J_1IREGSET-J_1IREGID,
            WAERS   LIKE T001-WAERS,
            SHIPFROM_IND TYPE C,                          " Added 10/12/1998
            RG23D_SERIALNO TYPE C,                        " Added 10/12/1998
         END OF J1IJ300.
    DATA :  TRNTYP(4)   TYPE C,
            CONDT-NAME(3) TYPE C,
            TOTAL_LRG23D   LIKE LIPS-LFIMG,
            ALLOC_LRG23D   LIKE LIPS-LFIMG,
            SHIPFROM_IND   LIKE J_1IEXCHDR-STATUS,
            RG23D_SERIALNO LIKE J_1IEXCHDR-STATUS.
    DATA : BEGIN OF XLIPS OCCURS 10,
    internal table to store the delivery item information
             VBELN LIKE LIPS-VBELN,
             POSNR LIKE LIPS-POSNR,
             MATNR LIKE LIPS-MATNR,
             MAKTX LIKE MAKT-MAKTX,
             WERKS LIKE LIPS-WERKS,
             LGORT LIKE LIPS-LGORT,
             CHARG LIKE LIPS-CHARG,
             LFIMG LIKE LIPS-LFIMG,
             MEINS LIKE LIPS-MEINS,
             BED   LIKE J_1IRG23D-EXBED,
             SED   LIKE J_1IRG23D-EXSED,
             AED   LIKE J_1IRG23D-EXAED,
             CUR   LIKE J_1IRG23D-EXCUR,
             SELFLAG TYPE C ,              "T=excise invoice selected
             INDEX LIKE SY-TABIX,          "index in the table
             FLG TYPE C.                   "item selection
    DATA : END OF XLIPS.
    DATA : CRG23D TYPE RG23D OCCURS 30 WITH HEADER LINE.
    contains all rg23d entries for the document
    DATA : LRG23D TYPE RG23D OCCURS 30 WITH HEADER LINE.
    contains item rg23d entries
    DATA : BEGIN OF Z_1IRG23D OCCURS 30.
    stores the data to be updated
            INCLUDE STRUCTURE J_1IRG23D.
    DATA : END OF Z_1IRG23D.
    DATA : BEGIN OF EXCINV OCCURS 30.
    factory inovoics selected for item
            INCLUDE STRUCTURE J_1IEXCDTL.
    DATA : END OF EXCINV.
    DATA : BEGIN OF ASSIGNED_EXCINV OCCURS 30.
            INCLUDE STRUCTURE J_1IEXCDTL.
    DATA : END OF ASSIGNED_EXCINV.
    DATA : A_INDEX LIKE SYST-TABIX.
    DATA : BEGIN OF LOCK_TABLE OCCURS 10,
    table containing plant-material combination and status of the lock
              WERKS  LIKE J_1IEXCDTL-WERKS,
              MATNR  LIKE J_1IEXCDTL-MATNR,
              STATUS TYPE C,                   "LOCKED/UNLOCKED
           END OF LOCK_TABLE.
    DATA : BEGIN OF LOCKTAB OCCURS 0,
               TRNTYP LIKE J_1IEXCDTL-TRNTYP,
               DOCNO  LIKE J_1IEXCDTL-DOCNO,
               DOCYR LIKE  J_1IEXCDTL-DOCYR,
               ZEILE LIKE  J_1IEXCDTL-ZEILE,
            END OF LOCKTAB.
    DATA :
          CRG23D-CTR  TYPE I,              "Line count of crg23d table
          SHIPFROM    LIKE J_1IRG23D-SHIPFROM,
          FOLIO       LIKE J_1IRG23D-FOLIO,
          SERIALNO    LIKE J_1IRG23D-SERIALNO,
          DEPEXNUM    LIKE J_1IRG23D-DEPEXNUM,
          DEPEXYEAR   LIKE J_1IRG23D-DEPEXYEAR.
    CONSTANTS :
       BED       LIKE CONDT-NAME VALUE 'BED',
       AED       LIKE CONDT-NAME VALUE 'AED',
       SED       LIKE CONDT-NAME VALUE 'SED',
       CES       LIKE CONDT-NAME VALUE 'CES',
       LOCKED    TYPE C          VALUE '1',
       UNLOCKED  TYPE C          VALUE '2'.
    AT SELECTION-SCREEN.
       PERFORM CHECK_VBELN_INPUT.
    IF     FCODE = 'S'.
           PERFORM DELIVERY_START_USER_EXIT.
           PERFORM READ_DELIVERY_HEADER.
           PERFORM GET_COMP_CODE.
           PERFORM READ_CUSTOMISATION.
           PERFORM GET_ITEM_INFO.
           PERFORM LOCKING.
           PERFORM RG23D_SELECTION.
           PERFORM SAVE_DOCUMENT.
           MESSAGE I000 WITH 'Selection Complete for Delivery ' DELIVERY.
    ELSEIF FCODE = 'V'.
           PERFORM GET_COMP_CODE.
           PERFORM READ_CUSTOMISATION.
           PERFORM GET_ITEM_INFO.
           PERFORM LOCKING.
           PERFORM UPDATE_DOCUMENT.
           MESSAGE I000 WITH 'Verfiy/Post Complete for Delivery ' DELIVERY.
    ENDIF.
    FORM CHECK_VBELN_INPUT.
    Validate Function Code
       IF NOT ( FCODE = 'S' OR FCODE = 'V' ).
         MESSAGE E000 WITH 'Valid Functions are S/V - Select/Verify Post'.
       ENDIF.
      IF DELIVERY IS INITIAL.
         MESSAGE E000 WITH 'Delivery number cannot be initial'.
      ENDIF.
    check if goods issue done for the delivery
        SELECT SINGLE WBSTK INTO VBUK-WBSTK
            FROM  VBUK
            WHERE VBELN = DELIVERY.
        IF  SY-SUBRC = 0.
            IF VBUK-WBSTK <> 'C' AND FCODE = 'V'.
               MESSAGE W339 WITH DELIVERY.
            ENDIF.
        ELSE.
               MESSAGE E000 WITH 'Invalid Delivery'.
        ENDIF.
    if in select mode check if excise invoice already selected for delive
        SELECT SINGLE * FROM J_1IRG23D
            WHERE VBELN = DELIVERY.
        IF     FCODE = 'S'.
               IF SY-SUBRC = 0.
                  MESSAGE E325 WITH DELIVERY.
               ENDIF.
        ELSEIF FCODE = 'V'.
               IF     SY-SUBRC NE 0.
                      MESSAGE E000 WITH 'Selection not over for ' DELIVERY.
               ELSEIF J_1IRG23D-STATUS = 'P'.
                      MESSAGE E000 WITH 'Record Already Posted '.
               ENDIF.
        ENDIF.
      CLEAR J_1IRG23D.
    ENDFORM.                    " CHECK_VBELN_INPUT
    FORM READ_DELIVERY_HEADER.
      SELECT SINGLE * FROM LIKP
        WHERE VBELN = DELIVERY.
    get the sold-to-party
      CLEAR: KUAGV, KUWEV.
      SELECT SINGLE KUNNR NAME1 LAND1
              FROM KNA1 INTO (KUAGV-KUNNR,KUAGV-NAME1,KUAGV-LAND1)
         WHERE KUNNR = LIKP-KUNAG.
    get the ship-to-party
      SELECT SINGLE KUNNR LAND1 NAME1
              FROM KNA1 INTO (KUWEV-KUNNR,KUWEV-LAND1,KUWEV-NAME1)
          WHERE KUNNR = LIKP-KUNNR.
    ENDFORM.                    " READ_DELIVERY_HEADER
    FORM GET_COMP_CODE.
    get the company code of the document from the sales organisation
      CLEAR TVKO-BUKRS.
      SELECT SINGLE BUKRS FROM TVKO INTO TVKO-BUKRS
        WHERE VKORG = LIKP-VKORG.
      J1IJ300-BUKRS = TVKO-BUKRS.
      SELECT SINGLE WAERS FROM T001 INTO J1IJ300-WAERS
        WHERE BUKRS = J1IJ300-BUKRS.
    ENDFORM.                    " GET_COMP_CODE
    FORM READ_CUSTOMISATION.
      SELECT SINGLE WERKS INTO J1IJ300-WERKS
           FROM   LIPS
           WHERE  VBELN = DELIVERY.
    Plant level customisation
      SELECT SINGLE * FROM  J_1IWRKCUS
             WHERE  J_1IWERKS   = J1IJ300-WERKS .
      IF SY-SUBRC <> 0.
        MESSAGE E303 WITH 'plant' J1IJ300-WERKS 'J_1IWRKCUS'.
      ENDIF.
      IF J_1IWRKCUS-J_1IDEPOT IS INITIAL.
    plant is defined as factory
        MESSAGE E322 WITH J1IJ300-WERKS.
      ENDIF.
      J1IJ300-REGID = J_1IWRKCUS-J_1IREGID.
      TRNTYP = 'DLDO'.
      SELECT SINGLE * FROM J_1IREGSET
           WHERE J_1IREGID = J1IJ300-REGID.
      IF SY-SUBRC <> 0.
        MESSAGE E303 WITH 'Register id' J1IJ300-REGID 'J_1IREGSET'.
      ENDIF.
    ENDFORM.                    " READ_CUSTOMISATION
    *&      Form  GET_ITEM_INFO
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM GET_ITEM_INFO.
      REFRESH : CRG23D, LRG23D, EXCINV, XLIPS.
      PERFORM READ_DELIVERY_ITEM.
    ENDFORM.                    " GET_ITEM_INFO
    *&      Form  READ_DELIVERY_ITEM
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM READ_DELIVERY_ITEM.
      DATA : CNT LIKE SY-TABIX.
      CLEAR CNT.
      REFRESH XLIPS.
      SELECT * FROM LIPS
         WHERE VBELN = DELIVERY.
    read the delivery item
    perform plant checking only if in create mode
          IF LIPS-WERKS <> J1IJ300-WERKS.
    plant is different from that of the first item
            SELECT SINGLE J_1IREGID INTO J_1IWRKCUS-J_1IREGID
                 FROM   J_1IWRKCUS
                 WHERE  J_1IWERKS = LIPS-WERKS.
            IF SY-SUBRC <> 0.
              MESSAGE E303 WITH 'plant' LIPS-WERKS 'J_1IWRKCUS'.
            ENDIF.
            IF J_1IWRKCUS-J_1IREGID <> J1IJ300-REGID.
    register id of the two plants are different
              MESSAGE E338 WITH DELIVERY.
            ENDIF.
          ENDIF.
        CLEAR XLIPS.
    store the item details
        XLIPS-VBELN = LIPS-VBELN.
        XLIPS-POSNR = LIPS-POSNR.
        XLIPS-MATNR = LIPS-MATNR.
        PERFORM GET_MATERIAL_DESC
              USING XLIPS-MATNR
                    XLIPS-MAKTX.
       XLIPS-WERKS = LIPS-WERKS.
       XLIPS-LGORT = LIPS-LGORT.
       XLIPS-CHARG = LIPS-CHARG.
       XLIPS-LFIMG = LIPS-LFIMG.
       XLIPS-MEINS = LIPS-VRKME.                           "changed 2.3.98
       CLEAR : XLIPS-BED, XLIPS-SED, XLIPS-AED.
       XLIPS-CUR = J1IJ300-BUKRS.
       CNT = CNT + 1.
       XLIPS-INDEX = CNT.
       XLIPS-SELFLAG = 'F'.
       APPEND XLIPS.
    ENDSELECT.
    ENDFORM.                    " READ_DELIVERY_ITEM
    *&      Form  GET_MATERIAL_DESC
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM GET_MATERIAL_DESC USING MATNR MAKTX.
      SELECT SINGLE MAKTX FROM  MAKT INTO MAKTX
             WHERE  MATNR       = MATNR
             AND    SPRAS       = 'E'            .
    ENDFORM.                               " GET_MATERIAL_DESC
    *&      Form  LOCKING
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM LOCKING.
    REFRESH LOCK_TABLE.
    LOOP AT XLIPS.
      LOCK_TABLE-WERKS  = XLIPS-WERKS.
      LOCK_TABLE-MATNR  = XLIPS-MATNR.
      LOCK_TABLE-STATUS = UNLOCKED.
      COLLECT LOCK_TABLE.
    ENDLOOP.
    PERFORM LOCK_UNLOCK_PLANT_MATERIAL USING LOCKED.
      SELECT TRNTYP DOCNO DOCYR ZEILE INTO
          (LOCKTAB-TRNTYP,
          LOCKTAB-DOCNO,LOCKTAB-DOCYR,
          LOCKTAB-ZEILE)
                              FROM   J_1IEXCDTL
                          WHERE TRNTYP = 'GRPO'
                          AND  WERKS = XLIPS-WERKS
                          AND  LGORT = XLIPS-LGORT
                          AND  MATNR = XLIPS-MATNR
                          AND  CHARG = XLIPS-CHARG.
        APPEND LOCKTAB.
      ENDSELECT.
    *share lock for all excise invoices
      LOOP AT LOCKTAB.
        CALL FUNCTION 'ENQUEUE_EJ_1IEXDTL'
             EXPORTING
                  MODE_J_1IEXCDTL = 'S'
                  MANDT           = SY-MANDT
                  TRNTYP          = LOCKTAB-TRNTYP
                  DOCYR           = LOCKTAB-DOCYR
                  DOCNO           = LOCKTAB-DOCNO
                  ZEILE           = LOCKTAB-ZEILE
             EXCEPTIONS
                  FOREIGN_LOCK    = 1
                  SYSTEM_FAILURE  = 2
                  OTHERS          = 3.
      ENDLOOP.
    ENDFORM.                    " LOCKING
    *&      Form  LOCK_UNLOCK_PLANT_MATERIAL
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM LOCK_UNLOCK_PLANT_MATERIAL USING ACTION.
      DATA: __UNAME  LIKE SY-UNAME,
            __OBJECT LIKE DD25V-VIEWNAME.
      DATA : BEGIN OF LOCK_STRUCT,
               GRANNAME(10)   VALUE 'J1IJ',
               ENQMODE        VALUE 'E',
               MANDT          LIKE  SY-MANDT,
               WERKS          LIKE  J_1IEXCDTL-WERKS,
               MATNR          LIKE  J_1IEXCDTL-MATNR,
            END OF LOCK_STRUCT.
      LOCK_STRUCT-MANDT = SY-MANDT.
      LOOP AT LOCK_TABLE WHERE STATUS <> ACTION.
    perform the locking/unlocking operation only for the items for which
    it is not already done
        LOCK_STRUCT-WERKS = LOCK_TABLE-WERKS.
        LOCK_STRUCT-MATNR = LOCK_TABLE-MATNR.
       CALL 'C_ENQUEUE'
         ID 'OPCODE'           FIELD ACTION
         ID 'ENQOBJ'           FIELD 'J_1IJ'
         ID '01'               FIELD LOCK_STRUCT
         ID 'COLLISION_UNAME'  FIELD __UNAME
         ID 'COLLISION_OBJECT' FIELD __OBJECT.
       CASE SY-SUBRC.
         WHEN 0.
           LOCK_TABLE-STATUS = ACTION.
           MODIFY LOCK_TABLE.
         WHEN 2.
           MESSAGE E341 WITH LOCK_TABLE-WERKS LOCK_TABLE-MATNR  __UNAME.
         WHEN OTHERS.
           IF ACTION = LOCKED.
             MESSAGE E342 WITH 'locking'
                               LOCK_TABLE-WERKS LOCK_TABLE-MATNR.
           ELSE.
             MESSAGE E342 WITH 'unlocking'
                               LOCK_TABLE-WERKS LOCK_TABLE-MATNR.
           ENDIF.
       ENDCASE.
      ENDLOOP.
    ENDFORM.                    " LOCK_UNLOCK_PLANT_MATERIAL
    *&      Form  RG23D_SELECTION
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM RG23D_SELECTION.
    REFRESH CRG23D.
    REFRESH ASSIGNED_EXCINV.
    LOOP AT XLIPS.
    *write: / xlips-vbeln,xlips-posnr,xlips-matnr, xlips-meins, xlips-lfimg.
    REFRESH EXCINV.
    CALL FUNCTION 'J_1I6_SELECT_EXCISE_INVOICE_DE'
         EXPORTING
             BUKRS        = J1IJ300-BUKRS
             CHARG        = XLIPS-CHARG
             WERKS        = XLIPS-WERKS
             EXGRP        = EXCGROUP
             MATNR        = XLIPS-MATNR
             QTY_CHECK    = 'X'
             MULTI        = 'X'
             NO_DAY_CHECK = 'X'
             SHIPFROM     = SHIPFROM
             LGORT        = XLIPS-LGORT
         TABLES
              EXC_TAB     = EXCINV
         EXCEPTIONS
              OTHERS       = 1.
         TOTAL_LRG23D = 0.
         ALLOC_LRG23D = 0.
         SORT EXCINV BY DOCYR DOCNO .
         LOOP AT ASSIGNED_EXCINV.
            READ TABLE EXCINV WITH KEY DOCYR = ASSIGNED_EXCINV-DOCYR
                                     DOCNO = ASSIGNED_EXCINV-DOCNO
                                     ZEILE = ASSIGNED_EXCINV-ZEILE
                                     BINARY SEARCH.
            IF SY-SUBRC = 0.
               A_INDEX = SY-TABIX.
               EXCINV-MENGR = EXCINV-MENGR - ASSIGNED_EXCINV-MENGR.
               MODIFY EXCINV INDEX A_INDEX .
            ENDIF.
         ENDLOOP.
         DELETE EXCINV WHERE MENGR = 0.
    total_lrg23d = total balance quantity in the selected excise invoices
    alloc_lrg23d = Quantity allocated to a delivery line item,
    Allocation continues till
      - We have balance quantity in excise invoice selection
      - Till total delivery quantity is allocated
        LOOP AT EXCINV.
      To Force the same shipfrom for all the excise invoices
      Shipfrom Ind can be determined in the start user-exit
        IF  J1IJ300-SHIPFROM_IND = 'Y'.
            IF  XLIPS-INDEX = 1 AND SY-TABIX = 1.
                SHIPFROM = EXCINV-SHIPFROM.
            ENDIF.
            IF SHIPFROM NE EXCINV-SHIPFROM.
               EXCINV-RIND3 = 'X'.
               MODIFY EXCINV.
               CONTINUE.
            ENDIF.
        ENDIF.
      Allocation
        IF XLIPS-LFIMG NE ALLOC_LRG23D.
            TOTAL_LRG23D = TOTAL_LRG23D + EXCINV-MENGR.
            IF XLIPS-LFIMG > TOTAL_LRG23D.
               ALLOC_LRG23D = ALLOC_LRG23D + EXCINV-MENGR.
            ELSE.
               EXCINV-MENGR = XLIPS-LFIMG - ALLOC_LRG23D.
               ALLOC_LRG23D = ALLOC_LRG23D + EXCINV-MENGR.
            ENDIF.
        ELSE.
               EXCINV-RIND3 = 'X'.
         ENDIF.
         MODIFY EXCINV.
         ENDLOOP.
         DELETE EXCINV WHERE RIND3 = 'X'.
         LOOP AT EXCINV.
            MOVE-CORRESPONDING EXCINV TO ASSIGNED_EXCINV.
            APPEND ASSIGNED_EXCINV.
            CLEAR ASSIGNED_EXCINV.
         ENDLOOP.
         IF TOTAL_LRG23D < XLIPS-LFIMG.
            MESSAGE E000 WITH 'Not enough balance in RG23D ......'.
        ENDIF.
    Collect all allocated excise invoices to crg23d table
      LOOP AT EXCINV.
        PERFORM FILL_CRG23D.
        APPEND CRG23D.
      ENDLOOP.
    ENDLOOP.
    ENDFORM.                    " RG23D_SELECTION
    *&      Form  SAVE_DOCUMENT
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM SAVE_DOCUMENT.
          PERFORM PREPARE_RG23D_DATA.
    Generate RG23D serial number and Excise Invoice Serial Number
       IF J1IJ300-RG23D_SERIALNO = 'Y'.
       PERFORM GENERATE_RG23D_SERIAL ON COMMIT.
       ENDIF.
       PERFORM GENERATE_EXCISE_INV_SERIAL ON COMMIT.
         CALL FUNCTION 'J_1I7_USEREXIT_DEPOT_BEF_SAVE'
              TABLES
                   RG23D   = Z_1IRG23D
              EXCEPTIONS
                   OTHERS  = 1.
         PERFORM UPDATE_RG23D ON COMMIT.
         PERFORM UPDATE_EXCDTL ON COMMIT.
         COMMIT WORK.
        PERFORM LOCK_UNLOCK_PLANT_MATERIAL USING UNLOCKED.
         PERFORM UNLOCKING.
         MESSAGE S333 WITH DELIVERY.
    ENDFORM.                    " SAVE_DOCUMENT
    *&      Form  PREPARE_RG23D_DATA
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM PREPARE_RG23D_DATA.
      REFRESH Z_1IRG23D.
      LOOP AT CRG23D WHERE MENGE <> 0.
        CLEAR Z_1IRG23D.
        Z_1IRG23D = CRG23D.
        Z_1IRG23D-USNAM = SY-UNAME.
        Z_1IRG23D-CPUDT = SY-DATUM.
        Z_1IRG23D-EXGRP    = EXCGROUP.
        Z_1IRG23D-SRGRP    = SERGROUP.
        APPEND Z_1IRG23D.
        IF CRG23D-ADDAED <> 0 OR CRG23D-ADDSED <> 0 OR CRG23D-ADDAED <> 0 .
    additional excise is applicable
    make quantity zero for A certificate entries
          CLEAR : Z_1IRG23D-MENGE.
    get all the A certificates for the excise document item
          SELECT * FROM J_1IEXCDTL
    TODO : add the transaction type to the selection procedure
                 WHERE RDOC1    = CRG23D-DOCNO
                 AND   RYEAR1   = CRG23D-DOCYR
                 AND   RITEM1   = CRG23D-ZEILE
                 AND   RIND1    = 'G'.
    get the A certificate number
            SELECT SINGLE
                   EXNUM EXYEAR INTO (Z_1IRG23D-EXNUM, Z_1IRG23D-EXYEAR)
                   FROM  J_1IEXCHDR
                   WHERE  TRNTYP = J_1IEXCDTL-TRNTYP
                   AND    DOCYR  = J_1IEXCDTL-DOCYR
                   AND    DOCNO  = J_1IEXCDTL-DOCNO.
            Z_1IRG23D-TRNTYP = J_1IEXCDTL-TRNTYP.
            Z_1IRG23D-DOCYR  = J_1IEXCDTL-DOCYR.
            Z_1IRG23D-DOCNO  = J_1IEXCDTL-DOCNO.
            Z_1IRG23D-ZEILE  = J_1IEXCDTL-ZEILE.
            Z_1IRG23D-EXBED  = ( J_1IEXCDTL-EXBED * CRG23D-MENGE )
                                          / CRG23D-MENGA.
            Z_1IRG23D-EXSED  = ( J_1IEXCDTL-EXSED * CRG23D-MENGE )
                                          / CRG23D-MENGA.
            Z_1IRG23D-EXAED  = ( J_1IEXCDTL-EXAED * CRG23D-MENGE )
                                          / CRG23D-MENGA.
            Z_1IRG23D-RG23ASER = J_1IEXCDTL-RG23ASER.
            Z_1IRG23D-RG23CSER = J_1IEXCDTL-RG23CSER.
            Z_1IRG23D-RGPLASER = J_1IEXCDTL-RGPLASER.
            APPEND Z_1IRG23D.
          ENDSELECT.
        ENDIF.
    ENDLOOP.
    ENDFORM.                    " PREPARE_RG23D_DATA
    *&      Form  UPDATE_RG23D
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM UPDATE_RG23D.
    *update the rg23d register
      INSERT J_1IRG23D FROM TABLE Z_1IRG23D ACCEPTING DUPLICATE KEYS.
      IF SY-SUBRC <> 0.
        MESSAGE A308 WITH 'J_1IRG23D'.
      ENDIF.
    ENDFORM.                    " UPDATE_RG23D
    *&      Form  UPDATE_EXCDTL
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM UPDATE_EXCDTL.
      LOOP AT CRG23D WHERE MENGE <> 0.
    update the remaining quantity in the excise invoice item tables
        UPDATE J_1IEXCDTL
           SET      MENGR   = MENGR - CRG23D-MENGE
                    AENAM   = SY-UNAME
                    AEDAT   = SY-DATUM
           WHERE    TRNTYP  = 'GRPO'
             AND    DOCYR   = CRG23D-DOCYR
             AND    DOCNO   = CRG23D-DOCNO
             AND    ZEILE   = CRG23D-ZEILE.
        IF SY-SUBRC <> 0.
          MESSAGE A308 WITH 'J_1IRG23D'.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " UPDATE_EXCDTL
    *&      Form  FILL_CRG23D
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM FILL_CRG23D.
      CRG23D-TRNTYP   = EXCINV-TRNTYP.
      CRG23D-DOCYR    = EXCINV-DOCYR.
      CRG23D-DOCNO    = EXCINV-DOCNO.
      CRG23D-ZEILE    = EXCINV-ZEILE.
      CRG23D-VBELN    = XLIPS-VBELN.
      CRG23D-POSNR    = XLIPS-POSNR.
      CRG23D-EXNUM    = EXCINV-EXNUM.
      CRG23D-EXYEAR   = EXCINV-EXYEAR.
      CRG23D-LIFNR    = EXCINV-LIFNR.
      CRG23D-MATNR    = EXCINV-MATNR.
      CRG23D-MAKTX    = EXCINV-MAKTX.
      CRG23D-CHAPID   = EXCINV-CHAPID.
      CRG23D-MEINS    = EXCINV-MENGR_UOM.
      CRG23D-WERKS    = EXCINV-WERKS.
      CRG23D-EXCUR    = EXCINV-EXCUR.
      CRG23D-RG23ASER = EXCINV-RG23ASER.
      CRG23D-RG23CSER = EXCINV-RG23CSER.
      CRG23D-RGPLASER = EXCINV-RGPLASER.
      CRG23D-MENGR    = EXCINV-MENGR.
      CRG23D-MENGA    = EXCINV-MENGA.
      CRG23D-MENGE    = EXCINV-MENGR.            " Move the allocated Qty
      CRG23D-EXBED    = ( EXCINV-EXBED  * CRG23D-MENGE ) / EXCINV-MENGA.
      CRG23D-EXSED    = ( EXCINV-EXSED  * CRG23D-MENGE ) / EXCINV-MENGA.
      CRG23D-EXAED    = ( EXCINV-EXAED  * CRG23D-MENGE ) / EXCINV-MENGA.
    ENDFORM.                    " FILL_CRG23D
    *&      Form  UPDATE_DOCUMENT
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM UPDATE_DOCUMENT.
    LOOP AT XLIPS.
      UPDATE J_1IRG23D SET STATUS = 'P'
      WHERE  VBELN       = XLIPS-VBELN
      AND    POSNR       = XLIPS-POSNR.
    ENDLOOP.
    COMMIT WORK.
    ENDFORM.                    " UPDATE_DOCUMENT
    *&      Form  DELIVERY_START_USER_EXIT
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM DELIVERY_START_USER_EXIT.
    CALL FUNCTION 'J_1I7_USEREXIT_EXGRP_DETERM'
         EXPORTING
              EXCGRP         = EXCGROUP
            MBLNR          =
            MJAHR          =
            VENDOR         =
              VBELN          = DELIVERY
         IMPORTING
              EXCGRP         = EXCGROUP
              SHIPFROM_IND   = J1IJ300-SHIPFROM_IND
              RG23D_SERIALNO = J1IJ300-RG23D_SERIALNO
         EXCEPTIONS
              OTHERS         = 1.
    CALL FUNCTION 'J_1I7_USEREXIT_SERGRP_DETERM'
         EXPORTING
              SRGRP          = SERGROUP
            MBLNR          =
            MJAHR          =
              VBELN          = DELIVERY
         IMPORTING
              SRGRP          = SERGROUP
         EXCEPTIONS
              OTHERS         = 1.
    ENDFORM.                    " DELIVERY_START_USER_EXIT
    *&      Form  GENERATE_RG23D_SERIAL
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM GENERATE_RG23D_SERIAL.
      LOOP AT Z_1IRG23D WHERE MENGE <> 0.
      CLEAR: FOLIO, SERIALNO.
      SELECT MAX( FOLIO ) MAX( SERIALNO )
      INTO   (Z_1IRG23D-FOLIO, Z_1IRG23D-SERIALNO)
      FROM   J_1IRG23D
      WHERE  TRNTYP = Z_1IRG23D-TRNTYP
      AND    DOCNO  = Z_1IRG23D-DOCNO
      AND    DOCYR  = Z_1IRG23D-DOCYR
      AND    ZEILE  = Z_1IRG23D-ZEILE.
      MODIFY Z_1IRG23D.
      ENDLOOP.
    ENDFORM.                    " GENERATE_RG23D_SERIAL
    *&      Form  GENERATE_EXCISE_INV_SERIAL
          text                                                           *
    -->  p1        text
    <--  p2        text
    FORM GENERATE_EXCISE_INV_SERIAL.
      CLEAR: DEPEXNUM, DEPEXYEAR.
    CALL FUNCTION 'J_1I6_DETERMINE_EXC_YEAR'
         EXPORTING
              I_BUKRS      = J1IJ300-BUKRS
         IMPORTING
              EXCISE_YEAR  = DEPEXYEAR
         EXCEPTIONS
              MISS_COMPANY = 1
              OTHERS       = 2.
      IF SY-SUBRC NE 0.
        MESSAGE E526 WITH 'Company ' J1IJ300-BUKRS.
      ENDIF.
      CALL FUNCTION 'NUMBER_GET_NEXT'
           EXPORTING
                NR_RANGE_NR             = '01'
                OBJECT                  = 'J_1IDEPINV'
                QUANTITY                = '1'
                SUBOBJECT               = SERGROUP
                TOYEAR                  = DEPEXYEAR
           IMPORTING
                NUMBER                  = DEPEXNUM
           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
                OTHERS                  = 7.
      CASE SY-SUBRC.
        WHEN 0.
        WHEN 1.
          MESSAGE A336 WITH 'internal document' ': Interval not found'
                            '. Number object : J_1IDEPINV'.
        WHEN 3.
          MESSAGE A336 WITH 'internal document' ': Object not found'
                            '. Number object : J_1IDEPINV'.
        WHEN OTHERS.
          MESSAGE A336 WITH 'internal document'
                            '. Number object : J_1IDEPINV'.
      ENDCASE.
    Update Depot Excise Invoice Year and Number in the table
      LOOP AT Z_1IRG23D.
        Z_1IRG23D-SERIALNO  = Z_1IRG23D-SERIALNO + 1.
        Z_1IRG23D-DEPEXYEAR = DEPEXYEAR.
        Z_1IRG23D-DEPEXNUM  = DEPEXNUM.
        MODIFY Z_1IRG23D.
      ENDLOOP.
    ENDFORM.                    " GENERATE_EXCISE_INV_SERIAL
    *&      Form  UNLOCKING
          text
    -->  p1        text
    <--  p2        text
    FORM UNLOCKING.
      LOOP AT LOCKTAB.
        CALL FUNCTION 'DEQUEUE_EJ_1IEXDTL'
             EXPORTING
                  MODE_J_1IEXCDTL = 'S'
                  MANDT           = SY-MANDT
                  TRNTYP          = LOCKTAB-TRNTYP
                  DOCYR           = LOCKTAB-DOCYR
                  DOCNO           = LOCKTAB-DOCNO
                  ZEILE           = LOCKTAB-ZEILE.
      ENDLOOP.
    ENDFORM.                    " UNLOCKING

  • Failed to download updates to the WUAgent datastore (error = 0x8009000 / -2146893815)

    We have a central site (SRVSC00) and two primary child sites (SRVSC01/02) in our SCCM structure. All clients (3700) are connected to the child sites and reports to central site. All SU deployments are being deployed from central site. WSUS server (3.0 Sp2) is installed on each site (port 8530).
    I've deployed a patch (for the first time to all workstations) and over 130 clients failes.
    WUAHandler.log:
    "Failed to download updates to the WUAgent datastore (error = 0x8009000)"
    windowsupdate.log:
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:571 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:586 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:28:586 2304 b90 COMAPI WARNING: ISusInternal::GetEulaText failed, hr=80240033
    2010-02-26 10:19:30:086 1816 1494 DnldMgr ***********  DnldMgr: Copy update to cache [UpdateId = {A9E325EF-3002-4D74-9CC4-2CE1967678FB}.104]  ***********
    2010-02-26 10:19:30:086 1816 1494 DnldMgr WARNING: CryptAcquireContext failed with 0x80090009.
    2010-02-26 10:19:30:086 1816 1494 DnldMgr WARNING: GenerateHash failed with 0x80090009.
    2010-02-26 10:19:30:086 1816 1494 DnldMgr WARNING: GenerateDownloadDirName failed with 0x80090009.
    2010-02-26 10:19:30:086 1816 1494 DnldMgr   * WARNING: Copy update to cache failed with exit code = 0x80090009
    2010-02-26 10:19:30:086 2304 45c COMAPI WARNING: ISusInternal::CopyUpdateToCache2 failed, hr=80090009
    2010-02-26 10:19:30:196 2304 45c COMAPI -------------
    2010-02-26 10:19:30:196 2304 45c COMAPI -- START --  COMAPI: Search [ClientId = CcmExec]
    2010-02-26 10:19:30:196 2304 45c COMAPI ---------
    2010-02-26 10:19:30:196 1816 173c Agent *************
    2010-02-26 10:19:30:196 1816 173c Agent ** START **  Agent: Finding updates [CallerId = CcmExec]
    2010-02-26 10:19:30:196 1816 173c Agent *********
    2010-02-26 10:19:30:196 1816 173c Agent   * Include potentially superseded updates
    2010-02-26 10:19:30:196 2304 45c COMAPI <<-- SUBMITTED -- COMAPI: Search [ClientId = CcmExec]
    2010-02-26 10:19:30:196 1816 173c Agent   * Online = No; Ignore download priority = Yes
    2010-02-26 10:19:30:196 1816 173c Agent   * Criteria = "UpdateID = '0848ac63-ce07-4477-bc79-dae121d6bdda' AND DeploymentAction = *"
    2010-02-26 10:19:30:196 1816 173c Agent   * ServiceID = {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7} Managed
    2010-02-26 10:19:30:196 1816 173c Agent   * Search Scope = {Machine}
    2010-02-26 10:19:33:446 1816 173c Agent   * Added update {0848AC63-CE07-4477-BC79-DAE121D6BDDA}.104 to search result
    2010-02-26 10:19:33:446 1816 173c Agent   * Found 1 updates and 48 categories in search; evaluated appl. rules of 167 out of 2088 deployed entities
    2010-02-26 10:19:33:602 1816 173c Agent *********
    I've tried wsusutil reset in case the problem was eula. But this doesn't seem to have resolved the problem - if I did it correct :)
    Can anyone help me?

    Problem solved :D
    This has nothing to do with EULA. The problem is on Windows Update Components on the clients.
    I had to reset the Windeows Update components with Microsoft Microsoft Fix it 50202 2.1.1.1.
    Since we had the problem on 100-200 machines, we deployed the Microsoft Microsoft Fix it 50202 2.1.1.1 with SCCM. Windows Update started to work on each machine after the package had run :)

  • Logistics Extraction Structures Customizing Cockpit, (URGENT)

    Can someone give me a step by step way of how to use and apply Logistics Extraction Structures Customizing Cockpit. Eric Thanks.

    Pls have a look at the engagement rules of this forum:
    /thread/117232 [original link is broken]

  • Cannot start imported Hyper-V VM: The Security ID structure is invalid (0x80070539).

    I haven't seen any mention of this in any of the forums. I'm attempting to import a virtual machine to a Server 2012 R2 Hyper-V system. Normally this is fairly straight-forward. However, the imported virtual machine will not start. I'm getting the following
    error message:
    [Window Title]
    Hyper-V Manager
    [Main Instruction]
    An error occurred while attempting to start the selected virtual machine(s).
    [Content]
    'Unnamed VM' could not initialize.
    An attempt to read or update virtual machine configuration failed.
    [Expanded Information]
    'Unnamed VM' could not initialize. (Virtual machine ID )
    'Unnamed VM' could not read or update virtual machine configuration: The security ID structure is invalid. (0x80070539). (Virtual machine ID 223C7883-08C2-43ED-B5D1-7ABFC0940F64)
    I'm not familiar with what is going on here. Any ideas?
    Thank you.

    Hi michael,
    please try execute this powershell command.
    Grant-VmConnect Access -username (user account to boot the VM) -VmName (VM name).
    See if this work. I just tested and work on my side. For more detail, you can refer to http://www.ms4u.info/2014/01/cannot-start-imported-hyper-v-vm.html
    Lai (My blog:- http://www.ms4u.info)

  • What is the N900 directory structure?

    I have updated to the latest version of maemo and installed a few apps and added some music.
    When I clicked on the Ovi maps icon on the front screen, it never exited from the "Looking for GPS" message, so I exited via X.
    After, all my files (music, docs) and subdirectories were gone, and the entire file structure visible via File Manager in PC-Suite was only the folder "cities" with some subfolders in it.
    I would like to add music, etc. back in without having to drastically re-install the OS or something.  I did not yet back it up.
    Can anyone give a screen shot of the directory structure visible in PC-suite File Manager so that I can reconstruct it?
    Solved!
    Go to Solution.

    if you go in to settings, time and date and select the auto update option, then when you put the battery back in just accept the time and date it defaults to and it will correct it for you

  • Address change after update of the postal reference data in the SAP

    Hi experts,
    We are going to update our postal reference data in the SAP regional structure (SRxx, report RSADRLSM02).
    Can we use the tools for the Quarterly Adjustment to update our addresses ?
    Thanks in advance for your responses,

    Hi Frank,
    I am not sure what kind of project cost planning you are using.  Usually it is either direct WBS cost planning with CJR2 or cost roll up from Network Activities and Orders or ECP.
    The system will take AType price relevant for the period. If you have 100 hours with price 20 for Year N and 50 hours with price 30 for Year N+1, the planned cost will be 2000 + 1500 = 3500.
    CJ40 is the Overall Planning, but you still can select a year (as a period). In the Overall view you have no button for Activity Input, it will show up only when you select a year.
    Regards,
    Paulo

Maybe you are looking for