Inserting Extra Lines dynamically in Iprocurement

Hi,
We have a rqquirement in iProcurement. Here are the rules
1. Typically user queries for a item, adds it to the shpping cart.
2. Clicks on the 'Proceed To Checkout' button.
3. This takes him to the ShoppingCart page which lists all the items that have been selected. The users clicks next...and submits the requisition for approval.
In step1, sometimes the item selected is a 'Kit' i.e. it has multiple items within it. When such a kit is selected, the shopping cart(Step3) page should not display a single row for the kit but should 'blowup' the single line to multiple lines that makeup the kit. These constituent item lines should replace the would-have-been kit line in the shopping cart page.
I can write a query to determine if an item is a kit and retrieve the details of it's constituent items. When the shopping cart page is displayed it should have created and should display the extra rows for the constituent items with their details populated.
Lets say user added to the cart 3 items. Item1- a regular item, item2-a kit item with 2 detail items and item3-once again a regular item. The shopping cart will look like this:
Current Functionality;
Line1: Item1 $10 //(Regular Item) -
Line2: Item2 $20 //(Kit with items item21, item22)
Line3: Item3 $40 //(Regular item)
New Functionality:
Line1: Item1 $10 //(Regular Item)
Line2: Item21 $10 //blow up to detail
Line3: Item22 $10 //blow up to detail
Line4: Item3 $40 //(Regular Item)
What is the best way to achieve this in OAF? Where do I write the code?
Thanks

Hi Tapash,
Thanks for the info.
We are trying to change an iprocurement seeded page. I am new to the OAF and Java . I attended an OAF class last week and took an online java course the week before - info overload. So I have a lot of rookie questions
Based on your suggestion I am calculating this is what happens. Just my thought process. Please advise if it makes sense.
1. User selects a bunch of items and adds them to the shopping cart.
2. These selected items' numbers are stored somewhere (where?)
2. Clicks on 'proceed to checkout' button.
3. This causes the VO to build a query something like
select details from items_table where item_numbers in (those selected in 1 and stored in 2).
What I will need to do is extend the VORowImpl and in init_query method change the query from 3 to somehow include the constituent Kit items.
Is this correct?
BTW I have seen some of your posts and you are doing a great job making the transition to OAF palatable to a lot of people. If you don't already work for Oracle, they should be paying you for this.
Thanks
Sandeep

Similar Messages

  • IF statement inserts extra line.

    I am having problems with IF statements inserting extra lines;
    POH_VENDOR_NAME<?if:POH_PO_NUM != ''?>(POH_PO_NUM)<?end if?>
    Returns:
    Consolidated Supplies
    (1085)
    Instead of:
    Consolidated Supplies (1085)
    I have tried using CHOOSE but get the same results. Any help appreciated.
    Thanks
    Carl.

    Hi Carl,
    Hope your development is going ok. Not sure why the choose wouldn't work with @inline, if the IF statement did. What I would suggest instead is using a series of IF statements. So <?if@inline:x=1?> and the opposite <?if@inline:x!=1?>
    Its a bit of a pain, but I can't think of any other way to get around this.
    Regards,
    Cj

  • How to insert horizontal line dynamically after every line item in sapscrip

    Hi All,
    I have to insert a horizontal line  after every new item in sap script.
    How to do this .
    In some material there is2 line item or in other line item it ay be more .
    How to insert horizontal line dynamically after every line item
    Point will be rewarded
    Regards
    Niraj

    Hi Niraj,
    You can get your work done by keeping the horizontal line (&ULINE&) after all the item level fields, in this case once each item line is written you will get a horizontal line.
    In case you have different fields for the item lines which are optional (not printed every time) then you can have them in an IF....ENDIF condition and below the endif use a horizontal line.
    Some thing like this:
    /E ITEM_HEADER
    IL <TI>Item,,Material,,Description</>
    IP <TI>,,,,Quantity,,,,Price,,Price unit,,,,,,Value</>
    / &ULINE(71)&
    Let me know if this helps, else please describe your problem with an example.
    Luck.

  • Safari inserts extra lines in postings causing formating problems

    I am currently using Safari on the University of Phoenix website as an instructor. Whenever I post a reply to the students and post feedback to them, Safari inserts extra lines in the posting where ever, on when ever, the return key is used. For every carriage return, an extra line is ultimately inserted into the post. Does anyone know how to stop this?

    Please see this thread:
    http://discussions.apple.com/thread.jspa?threadID=1467276&tstart=0
    It might be the logic board, but indications are that it's an overheated graphics card. I have the exact same iMac you do (even with 3 gigs memory upgrade) and have similar problems.

  • Question re. inserting extra lines on a PDF table

    How do I insert extra lines in a table contained on a PDF?

    Hi Steve,
    That isn't something that you can do in Acrobat. However, you could use ExportPDF or Acrobat to save that PDF as an Excel spreadsheet, and add the extra line in Excel. For more information, see cloud.acrobat.com/exportpdf or www.adobe.com/products/acrobat.html cloud.acrobat.com/exportpdf.
    Best,
    Sara

  • Problem while inserting extra line item in XVBAP

    Hi Experts,
    I have to add extra line item in the Sale order through user exit.
    So i added new line item in the internal table XVBAK of the subroutine USEREXIT_SAVE_DOCUMENT_PREPARE (MV45AFZZ). Its working fine with the sales order. But when I create delivery of the same new iserted line item is not going to the delivery.
    Please give me solution...
    Thanks
    Sameer

    Hi Sameer,
    i think, you have added the line in XVBAP - not in XVBAK.
    And what's about VBEP - without an entry in VBEP, there will be no delivery note. There are also several indexes for the delivery.
    I hav'n dared to put an extra Line into the oder while Save_prepare.
    Perhaps try the bapi for order changing.
    You can get the new order-number while userexit Save. Save the need of change in an extra teble and change is via bapi with a background - job.
    Hans

  • Dynamically inserting new line in Internal table

    Hi,
      Can anyone help me how to insert a new line dynamically to the internal table.
    Assume there are 5 records that has been added to ITAB.
    In that if a particular field in that ITAB crosses the limit 10 then i have to split that line into two lines with the same data except that Par.field as 5 and the other record has 5.
    In the third record that particular field has value 10.
    Loop at ITAB.
       Once i found that field has 10 then how to insert a new line dynamically over here to add another record.
    endloop.

    Hi..
    Hi..
    try this..
    loop at itab.
    if  ( i found that field <f1> has 10 ).
        w_line2 = itab-f1+5(5).
        w_line3 = itab-f1.
    ***********First  line********   
        itab-f1 = itab-f1+0(5).
        modify itab index sy-tabix from itab transporting f1.
    ***********second  line********    Hi..
    try this..
    loop at itab.
    if  ( i found that field <f1> has 10 ).
        w_line2 = itab-f1+5(5).
        w_line3 = itab-f1.
    ***********First  line********   
        itab-f1 = itab-f1+0(5).
        modify itab index sy-tabix from itab transporting f1.
    ***********second  line********   
        itab-f1 = w_line2.
        insert itab INDEX SY-TABIX.
    **********third line**************
        itab-f1 = w_line3.
         insert itab INDEX SY-TABIX.
    endloop.  
        itab-f1 = w_line2.
        insert itab INDEX SY-TABIX.
    **********third line**************
        itab-f1 = w_line3.
         insert itab INDEX SY-TABIX.
    endloop.

  • Insertion of extra line item in delivery creation

    Hi,
    I have a requirement like after the creation of delivery from sale order, if we insert new line item in sale order , created delivery should be overwrite with newly added line item in sale order.
    Im using RV_DELIVERY_CREATE for creation of delivery and BAPI_OUTB DELIVERYCHANGE for change of delivery. But for the above mentioned requirement is not getting by these Function Modules.
    Let me know which parameters should i pass for insertion .
    Code will be more sufficient.
    Thanks in Advance

    Try with this FM WS_DELIVERY_UPDATE where u can modify the created delivery

  • GUI_DOWNLOAD : Extra Line

    Hi All,
    I am downloading the the internal table into a flat file using GUI_DOWNLOAD.
    I am getting an extra line at the end which is not required.
    I have debugged and found the content is correct.
    However in note pad a blank line apprers.
    Any help would be great.
    reagrds,

    REPORT  ZPP_GROSS_REQUIREMENT_UPLOAD.
    data : zwerks like BAPISITEMR-PLANT.
    DATA : BEGIN OF ITAB_REQ OCCURS 0,
              RECTYPE(4),
              PLANT(3),
              MATERIAL(12),
              MAT_TYPE(1),
              START_DATE(8),
              END_DATE(8),
              QTY(14),
              SIGN(1),
              FILLER(9),
           END OF ITAB_REQ.
    DATA : BEGIN OF ITAB_REQ2 OCCURS 0,
              RECTYPE(4),
              PLANT(3),
              MATERIAL(12),
              MAT_TYPE(1),
              START_DATE(8),
              END_DATE(8),
              QTY(14),
              SIGN(1),
              FILLER(9),
           END OF ITAB_REQ2.
    DATA : BEGIN OF ITAB_PLAN OCCURS 0,
            MANDT TYPE SY-MANDT,
            PLANNO LIKE ZPP_PLAN_NUMBER-PLANNO,
            PLNTIME LIKE ZPP_PLAN_NUMBER-PLNTIME,
            PLNDATE LIKE ZPP_PLAN_NUMBER-PLNDATE,
            ACTIVE LIKE ZPP_PLAN_NUMBER-ACTIVE,
           END OF  ITAB_PLAN .
    DATA : BEGIN OF ITAB_STATUS  OCCURS 0,
            MATERIAL LIKE MARA-MATNR,
            TYPE(1),
            DESC(200),
           END OF ITAB_STATUS  .
    data : p1(14) type p decimals 5.
    data : p2(13) type p decimals 3.
    data : p(15) type C.
    DATA : REQ_OUT LIKE BAPISITMEO OCCURS 0 WITH HEADER LINE,
           REQ_OUT1 LIKE BAPISITMEO OCCURS 0 WITH HEADER LINE,
           RET2 LIKE BAPIRETURN1 OCCURS 0 WITH HEADER LINE.
    DATA : REQ_IN LIKE BAPISSHDIN OCCURS 0 WITH HEADER LINE,
           RET3  LIKE BAPIRETURN1 OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF T1 OCCURS 0 ,
            MATNR LIKE MARA-MATNR,
            DATE_TYPE TYPE BAPISSHDIN-DATE_TYPE,
            REQ_DATE TYPE BAPISSHDIN-REQ_DATE,
            REQ_QTY TYPE BAPISSHDIN-REQ_QTY,
            UNIT TYPE BAPISSHDIN-UNIT,
          END OF T1.
    DATA: BEGIN OF ITAB_OLDPLAN OCCURS 0,
            MANDT TYPE ZPP_PLAN_NUMBER-MANDT,
            PLANNO TYPE ZPP_PLAN_NUMBER-PLANNO,
            PLNTIME TYPE ZPP_PLAN_NUMBER-PLNTIME,
            PLNDATE TYPE ZPP_PLAN_NUMBER-PLNDATE,
            ACTIVE TYPE ZPP_PLAN_NUMBER-ACTIVE,
           END OF ITAB_OLDPLAN.
    DATA: BEGIN OF ITAB_OLDPLAN1 OCCURS 0,
            MANDT TYPE ZPP_PLAN_NUMBER-MANDT,
            PLANNO TYPE ZPP_PLAN_NUMBER-PLANNO,
            PLNTIME TYPE ZPP_PLAN_NUMBER-PLNTIME,
            PLNDATE TYPE ZPP_PLAN_NUMBER-PLNDATE,
            ACTIVE TYPE ZPP_PLAN_NUMBER-ACTIVE,
           END OF ITAB_OLDPLAN1.
    DATA : PLNNO TYPE I.
    DATA : PLNNO1(10) TYPE C.
    DATA : PLNNO_NEW TYPE I.
    DATA : PLNNO_NEW1(10) TYPE C.
    DATA : RET LIKE BAPIRETURN1 OCCURS 0 WITH HEADER LINE.
    DATA : SCHEDULE_IN LIKE BAPISSHDIN OCCURS 0 WITH HEADER LINE.
    DATA : ITEMS LIKE BAPISITEMR OCCURS 0 WITH HEADER LINE .
    DATA : BEGIN OF T OCCURS 0,
             MATERIAL(12),
             DATE_TYPE(1),
             REQ_DATE LIKE SY-DATUM,
             REQ_QTY(13),
           END OF T.
    DATA : L_DATTIME(10) .
    *DATA : D1 like VTBBEWE-DBERVON, D2 like VTBBEWE-DBERBIS, D3 like VTBBEWE-ATAGE.
    DATA : D1 TYPE D, D2 TYPE D, D3 TYPE I.
    DATA QN(9) TYPE C.
    DATA DEC(9) TYPE C.
    DATA : TMAT(12).
    DATA : ACTIVE_REQ LIKE BAPISITEMR-REQ_NUMBER,
           DEACTIVE_REQ(10) TYPE C .
    SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-001.
    PARAMETER: P_FILE TYPE STRING DEFAULT
                                          'c:\data\gross_upload.txt'.
    *PARAMETER: P_PLAN LIKE AM60X-PBDNR.
    *PARAMETER: P_OLDPLN LIKE BAPISITEMR-REQ_NUMBER.
    SELECTION-SCREEN END OF BLOCK BLK.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      PERFORM GETFILE_NAME CHANGING P_FILE.
    TOP-OF-PAGE.
      WRITE :/35  '** GROSS REQUIREMENT UPLOAD **'.
      WRITE :/35  '******************************'.
    START-OF-SELECTION.
    perform CHECK_PLAN_NUMBER USING P_OLDPLN.
      PERFORM READ_FILE.  "Reads the input file using GUI_UPLOAD.
      PERFORM GET_OLD_PLAN. " GETS THE OLD PLAN NUMBER.
      PERFORM CREATE_PLAN_NUMBER. " Creates a new plan number for this week.
      PERFORM CREATE_GROSS_REQUIREMENT. " Creates the gross requirement.
      PERFORM WRITE_STATUS.
    *&      Form  READ_FILE
          Reads the input file using GUI_UPLOAD.
    -->  p1        text
    <--  p2        text
    FORM READ_FILE .
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = P_FILE
       FILETYPE                      = 'DAT'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          DATA_TAB                      = ITAB_REQ
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
       DESCRIBE TABLE ITAB_REQ LINES LIN.
         IF SY-TABIX = '1' OR SY-TABIX = LIN.
           CONTINUE.
         ENDIF.
    delete ITAB_REQ where MATERIAL+11(1) = 'I' and MAT_TYPE = 'P'.
    ENDFORM.                    " READ_FILE
    *&      Form  CREATE_GROSS_REQUIREMENT
          Creates the gross requirement
    -->  p1        text
    <--  p2        text
    FORM CREATE_GROSS_REQUIREMENT .
    *read table ITAB_REQ with  key RECTYPE = 'OP01'.
    *zwerks =  ITAB_REQ-PLANT.
      DELETE ITAB_REQ WHERE  RECTYPE NE 'PFAI'.
      SORT ITAB_REQ  BY MATERIAL.
      ITAB_REQ2[] = ITAB_REQ[] .
      DELETE ADJACENT DUPLICATES FROM ITAB_REQ2 COMPARING MATERIAL.
      LOOP AT ITAB_REQ .
        T-MATERIAL = ITAB_REQ-MATERIAL.
        D1 = ITAB_REQ-START_DATE.
        D2 = ITAB_REQ-END_DATE.
        IF D2 EQ '        '.
          D2 = D1 .
        ENDIF.
       D3 = D2 - D1.
       CALL FUNCTION 'CONVERT_DATE_FORMAT'
         EXPORTING
           I_DATE      = D1
         IMPORTING
           E_CALC_DATE = D1.
       CALL FUNCTION 'CONVERT_DATE_FORMAT'
         EXPORTING
           I_DATE      = D2
         IMPORTING
           E_CALC_DATE = D2.
       D3 = D2 - D1.
        CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
          EXPORTING
            BEG_DA     = D1
            END_DA     = D2
          IMPORTING
            NO_CAL_DAY = D3.
    *CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
    EXPORTING
       I_DATE_FROM          = d1
      I_KEY_DAY_FROM       = '00'
       I_DATE_TO            = d2
      I_KEY_DAY_TO         = '00'
      I_FLG_SEPARATE       = ' '
    IMPORTING
      E_DAYS               = d3
      E_MONTHS             =
      E_YEARS              =
        IF D3 < 7 AND D3 > 0.
          T-DATE_TYPE =  '2'. " Weekly
        ELSE.
          T-DATE_TYPE =  '3'. " Monthly
        ENDIF.
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        T-REQ_DATE = ITAB_REQ-START_DATE.
        QN = ITAB_REQ-QTY+0(9).
        DEC = ITAB_REQ-QTY+9(5).
        CONCATENATE QN '.' DEC INTO p.
        p1 = p.
       p2 = p1.
       T-REQ_QTY = p2.
    T-REQ_QTY = p.
      T-REQ_QTY = ITAB_REQ-QTY+0(9).
        APPEND T.
        CLEAR : T, D1, D2, D3.
      ENDLOOP.
      DATA PNO LIKE BAPISITEMR-REQ_NUMBER.
      LOOP AT ITAB_REQ2.
        LOOP AT T WHERE MATERIAL = ITAB_REQ2-MATERIAL.
          SCHEDULE_IN-DATE_TYPE =  T-DATE_TYPE .
          SCHEDULE_IN-REQ_DATE = T-REQ_DATE .
          SCHEDULE_IN-REQ_QTY = T-REQ_QTY.
          APPEND SCHEDULE_IN.
        ENDLOOP.
        ITEMS-MATERIAL = ITAB_REQ2-MATERIAL .
        ITEMS-PLANT = zwerks .
        ITEMS-REQU_TYPE = ' ' .
        ITEMS-VERSION = '00' .
        ITEMS-VERS_ACTIV = 'X'.
        ITEMS-REQ_NUMBER = L_DATTIME.
        ACTIVE_REQ = L_DATTIME.
       APPEND ITEMS.
       D1 = ITAB_REQ-START_DATE.
       D2 = ITAB_REQ-END_DATE.
       D3 = D2 - D1.
       IF D3 > 7.
         SCHEDULE_IN-DATE_TYPE =  '3'. " MONTHLY
       ELSE.
         SCHEDULE_IN-DATE_TYPE =  '2'. " WEEKLY
       ENDIF.
       SCHEDULE_IN-REQ_DATE = ITAB_REQ-START_DATE .
       SCHEDULE_IN-REQ_QTY = ITAB_REQ-QTY.
       APPEND SCHEDULE_IN.
        CALL FUNCTION 'BAPI_REQUIREMENTS_CREATE'
          EXPORTING
            REQUIREMENTS_ITEM              = ITEMS
      REQUIREMENT_PARAM              =
           DO_COMMIT                      = 'X'
           UPDATE_MODE                    = 'X'
      REFER_TYPE                     = ' '
      PROFILID                       = ' '
    IMPORTING
      MATERIAL                       =
      PLANT                          =
      REQUIREMENTSTYPE               =
      VERSION                        =
       REQMTSPLANNUMBER               =
      MRP_AREA                       =
      MATERIAL_EVG                   =
          TABLES
            REQUIREMENTS_SCHEDULE_IN       = SCHEDULE_IN
      REQUIREMENTS_CHAR_IN           =
            RETURN                         = RET
       if sy-subrc ne 0.
       loop at ret.
       write :/  ret.
       endloop.
       endif.
        ITAB_STATUS-MATERIAL = ITAB_REQ2-MATERIAL.
       ITAB_STATUS-TYPE = RET-TYPE.
        ITAB_STATUS-DESC = RET-MESSAGE.
        IF RET-MESSAGE IS INITIAL.
          ITAB_STATUS-DESC = 'Requirement Created '.
        ENDIF.
        APPEND ITAB_STATUS.
        CLEAR ITAB_STATUS.
        CLEAR SCHEDULE_IN.
        REFRESH SCHEDULE_IN.
        CLEAR ITAB_REQ2.
        CLEAR T.
      ENDLOOP.
      ITAB_PLAN-MANDT = SY-MANDT.
      ITAB_PLAN-PLANNO = L_DATTIME.
      ITAB_PLAN-PLNTIME = SY-UZEIT.
      ITAB_PLAN-PLNDATE = SY-DATUM.
      ITAB_PLAN-ACTIVE = 'X'.
      APPEND ITAB_PLAN.
      CLEAR ITAB_PLAN.
      INSERT ZPP_PLAN_NUMBER FROM TABLE ITAB_PLAN.
      IF SY-SUBRC = 0.
        COMMIT WORK.
      ENDIF.
    ENDFORM.                    " CREATE_GROSS_REQUIREMENT
    *&      Form  WRITE_STATUS
          text
    -->  p1        text
    <--  p2        text
    FORM WRITE_STATUS .
      WRITE :/ ' REQUIREMENT PLAN NUMBER ACTIVATED   : ', ACTIVE_REQ.
      WRITE :/ ' REQUIREMENT PLAN NUMBER DEACTIVATED : ', DEACTIVE_REQ.
      ULINE.
      IF NOT ITAB_STATUS[] IS INITIAL. " WRITES ERROR MESSAGES
        WRITE SY-ULINE(110).
        WRITE :/1 SY-VLINE NO-GAP,
                6 'Material Number',
                24 SY-VLINE NO-GAP,
               25 'Return Code',
               38 SY-VLINE NO-GAP,
                39 'Return Message',
                110 SY-VLINE NO-GAP.
        WRITE SY-ULINE(110).
        LOOP AT ITAB_STATUS.
          WRITE :/1 SY-VLINE NO-GAP,
                  6 ITAB_STATUS-MATERIAL,
                  24 SY-VLINE NO-GAP,
                 25 ITAB_STATUS-TYPE,
                 38 SY-VLINE NO-GAP,
                  39 ITAB_STATUS-DESC,
                  110 SY-VLINE NO-GAP.
        ENDLOOP.
        WRITE SY-ULINE(110).
      ENDIF.
    ENDFORM.                    " WRITE_STATUS
    *&      Form  getfile_name
          text
         <--P_P_FILE  text
    FORM GETFILE_NAME  CHANGING P_P_FILE.
      DATA : TMP_FILE LIKE RLGRAP-FILENAME.
      TMP_FILE = P_P_FILE.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
      PROGRAM_NAME        = SYST-REPID
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
      STATIC              = ' '
         MASK                = ' .'
        CHANGING
          FILE_NAME           = TMP_FILE
       EXCEPTIONS
         MASK_TOO_LONG       = 1
         OTHERS              = 2.
      IF SY-SUBRC = 0.
        P_P_FILE = TMP_FILE.
      ENDIF.
    ENDFORM.                    " getfile_name
    *&      Form  DEACTIVATE_OLD_REQUIREMENT
          text
    -->  p1        text
    <--  p2        text
    FORM DEACTIVATE_OLD_REQUIREMENT .
      CALL FUNCTION 'BAPI_REQUIREMENTS_GETDETAIL'
        EXPORTING
          MATERIAL               = ' '
          PLANT                  = zwerks
          REQUIREMENTSTYPE       = ' '
          VERSION                = '00'
          REQMTSPLANNUMBER       = ITAB_OLDPLAN-PLANNO
      MRP_AREA               =
      MATERIAL_EVG           =
        TABLES
         REQUIREMENTS_OUT        = REQ_OUT
          RETURN                 = RET2
      IF SY-SUBRC = 0.
        LOOP AT REQ_OUT.
          T1-MATNR = REQ_OUT-MATERIAL.
          T1-DATE_TYPE = REQ_OUT-DATE_TYPE.
          T1-REQ_DATE = REQ_OUT-REQ_DATE.
          T1-REQ_QTY = REQ_OUT-REQ_QTY.
          T1-UNIT = REQ_OUT-UNIT.
          APPEND T1.
          CLEAR T1.
        ENDLOOP.
        REQ_OUT1[] = REQ_OUT[].
        SORT REQ_OUT1 BY MATERIAL.
        DELETE ADJACENT DUPLICATES FROM REQ_OUT1 COMPARING MATERIAL.
        LOOP AT REQ_OUT1.
          LOOP AT T1 WHERE MATNR = REQ_OUT1-MATERIAL.
            REQ_IN-DATE_TYPE = T1-DATE_TYPE.
            REQ_IN-REQ_DATE  = T1-REQ_DATE.
            REQ_IN-REQ_QTY   = T1-REQ_QTY.
            REQ_IN-UNIT      = T1-UNIT.
            APPEND REQ_IN.
            CLEAR REQ_IN.
          ENDLOOP.
          CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE'
            EXPORTING
              MATERIAL                       = REQ_OUT1-MATERIAL
              PLANT                          = zwerks
              REQUIREMENTSTYPE               = ' '
              VERSION                        = '00'
              REQMTSPLANNUMBER               = ITAB_OLDPLAN-PLANNO
              VERS_ACTIV                     = ' '
        REQUIREMENT_PARAM              =
        MRP_AREA                       =
              DO_COMMIT                      = 'X'
              UPDATE_MODE                    = 'X'
              DELETE_OLD                     = 'X'
        NO_WITHDR                      = ' '
        MATERIAL_EVG                   =
      IMPORTING
        REQUIREMENT_ITEM_OUT           =
             TABLES
              REQUIREMENTS_SCHEDULE_IN       = REQ_IN
        REQUIREMENTS_CHAR_IN           =
              RETURN                         = RET3
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " DEACTIVATE_OLD_REQUIREMENT
    *&      Form  CHECK_PLAN_NUMBER
          text
    -->  p1        text
    <--  p2        text
    FORM CHECK_PLAN_NUMBER . "USING P_P_OLDPLN.
    DATA : ITAB_PBIM TYPE PBIM .
    DATA MSG TYPE STRING.
    SELECT SINGLE * FROM PBIM INTO ITAB_PBIM WHERE PBDNR = P_PLAN.
    IF SY-SUBRC = 0.
       CONCATENATE 'THE PLAN NUMBER :  ' P_PLAN ' ALREADY EXIST' INTO MSG.
       MESSAGE MSG TYPE 'E'.
    ENDIF.
    SELECT SINGLE * FROM PBIM INTO ITAB_PBIM WHERE PBDNR = P_OLDPLN.
    IF SY-SUBRC NE 0.
       CONCATENATE 'THE PLAN NUMBER :  ' P_OLDPLN ' DOES NOT EXIST' INTO MSG.
       MESSAGE MSG TYPE 'E'.
    ENDIF.
    ENDFORM.                    " CHECK_PLAN_NUMBER
    *&      Form  GENERATE_PLAN_NUMBER
          text
    -->  p1        text
    <--  p2        text
    FORM CREATE_PLAN_NUMBER.
      PLNNO_NEW1 = PLNNO_NEW.
      CONDENSE PLNNO_NEW1.
      CONCATENATE SY-DATUM+2(6) PLNNO_NEW1 INTO L_DATTIME.
    ENDFORM.                    " CREATE_PLAN_NUMBER
    *&      Form  GET_OLD_PLAN
          text
    -->  p1        text
    <--  p2        text
    FORM GET_OLD_PLAN .
      SELECT * FROM ZPP_PLAN_NUMBER INTO TABLE ITAB_OLDPLAN WHERE ACTIVE = 'X'.
      IF SY-SUBRC = 0.
        READ TABLE ITAB_OLDPLAN WITH KEY ACTIVE = 'X'.
        PLNNO1 = ITAB_OLDPLAN-PLANNO+6(4).
        CONDENSE PLNNO1.
        PLNNO = PLNNO1.
        read table ITAB_REQ with  key RECTYPE = 'OP01'.
        zwerks =  ITAB_REQ-PLANT.
        PERFORM DEACTIVATE_OLD_REQUIREMENT. " PREVIOUS PLAN IS DEACTIVATED.
        ITAB_OLDPLAN1[] = ITAB_OLDPLAN[].
        CLEAR ITAB_OLDPLAN.
        REFRESH ITAB_OLDPLAN.
        READ TABLE ITAB_OLDPLAN1 WITH KEY ACTIVE = 'X'.
        ITAB_OLDPLAN-PLANNO = ITAB_OLDPLAN1-PLANNO.
        ITAB_OLDPLAN-PLNTIME = ITAB_OLDPLAN1-PLNTIME.
        ITAB_OLDPLAN-PLNDATE = ITAB_OLDPLAN1-PLNDATE.
        ITAB_OLDPLAN-ACTIVE = ' '.
        APPEND ITAB_OLDPLAN.
        CLEAR ITAB_OLDPLAN.
        DEACTIVE_REQ = ITAB_OLDPLAN1-PLANNO.
        MODIFY ZPP_PLAN_NUMBER FROM TABLE ITAB_OLDPLAN.
        IF SY-SUBRC = 0.
          COMMIT WORK.
        ENDIF.
      ENDIF.
      PLNNO_NEW = PLNNO + 1.
    ENDFORM.                    " GET_OLD_PLAN

  • Terminal generates so extra lines every time I use a pipe ? Any Ideas ?

    I am trying to extract my Public IP using bash, and have figured out several ways to do this, but I am having some unexpected lines in the result.
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 105 100 105 0 0 195 0 --:--:-- --:--:-- --:--:-- 0
    Anybody have any idea how to get rid of the extra lines ?
    I recently re-installed the OS on my machine, and switched over to bash. Ever since then every time I issue a command that contains a pipe, I am getting some extraneous lines before the result.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](09:56PM) -> [username] ~ $ curl http://checkip.dyndns.org/
    <html><head><title>Current IP Check</title></head><body>Current IP Address: 45.xxx.46.204</body></html>
    Comment : Need to get rid of everything except "45.xxx.46.204"
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:03PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | tr '' '\012' | grep '\.'
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 105 100 105 0 0 611 0 --:--:-- --:--:-- --:--:-- 0
    45.xxx.46.204
    Comment : OK. This returns the correct value but it inserted 3 additional lines prior to the result.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](09:56PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' '
    " 45.xxx.46.204 "
    Comment : This inserts replaces the unwanted characters with spaces, if I try to replace using '' the empty space, then "45.xxx.46.204" dissapears. It seems like a bug to me that you cannot replace a character with an empty value.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](09:57PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' ' | sed -e 's/ //g'
    45.xxx.46.204
    Comment : OK. But requires an extra step...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](09:57PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' ' | sed -e 's/ //g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt
    Comment : This works fine, sends the correct result to a file. The three extra lines remain with the terminal and do not go to the output file
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:21PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g'
    Current IP CheckCurrent IP Address: 45.xxx.46.204
    Comment : This uses sed instead of tr, but I still have to get rid of "Current IP CheckCurrent IP Address: "
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:22PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g' -e 's/[a-zA-Z :\r\n]*//g'
    45.xxx.46.204
    Comment : OK. This returns the correct value but it inserted 3 additional lines.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](10:37PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g' -e 's/[a-zA-Z :\r\n]*//g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    Comment : This works fine, sends the correct result to a file.
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](10:43PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g'
    45.xxx.46.204
    Comment : OK. This appears to be the easiest way to do this...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](10:44PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    Comment :
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:41PM) -> [username] ~ $ ifconfig | grep broadcast
    inet 192.168.1.102 netmask 0xffff0000 broadcast 192.168.255.255
    inet 192.168.1.153 netmask 0xffffff00 broadcast 192.168.1.255
    Comment : Now for the Private Addresses, and the netmask...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:46PM) -> [username] ~ $ ifconfig | grep broadcast | awk '{print $2 }'
    192.168.1.102
    192.168.1.153
    Comment : Now for the Private Addresses...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:49PM) -> [username] ~ $ curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; ifconfig | grep broadcast | awk '{print $2 }'
    45.xxx.46.204
    192.168.1.102
    192.168.1.153
    Comment : Here are the Public & Private Addresses
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.14.05](11:50PM) -> [username] ~ $ \
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; \
    ifconfig | grep broadcast | awk '{print $2 }'
    45.xxx.46.204
    192.168.1.102
    192.168.1.153
    Comment : This is a slightly different way to enter one command on each line
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.15.05](12:08AM) -> [username] ~ $ \
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt ; \
    ifconfig | grep broadcast | awk '{print $2 }' >> ~/Desktop/IP_Address.txt ; \
    open ~/Desktop/IP_Address.txt ;
    Comment : The Public & Private Addresses are sent to a file, and the file is opened
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    [2007.15.05](12:08AM) -> [username] ~ $ \
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' \
    ~/Desktop/IP_Address.txt ; \
    ifconfig | grep broadcast | awk '{print $2 }' \
    ~/Desktop/IP_Address.txt ; \
    open ~/Desktop/IP_Address.txt ;
    Comment : This is a slightly different way to view the commands
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    #!/bin/bash
    # ip.sh
    testfile=/Applications/BBEdit.app/
    if [ -d $testfile ] ;
    then
    # THE NEXT LINE GENERATES AN ERROR -> line 10:  : command not found
      echo ${testfile} exists!
    fi
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt
    ifconfig | grep broadcast | awk '{print $2 }' >> ~/Desktop/IP_Address.txt
    if [ -d /Applications/BBEdit.app ]; then
    open -a /Applications/BBEdit.app ~/Desktop/IP_Address.txt
    else
    open ~/Desktop/IP_Address.txt
    fi
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    SUMMARY : [PUBLIC & PRIVATE ADDRESS]
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; ifconfig | grep broadcast | awk '{print $2 }'
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    SUMMARY : [PUBLIC ADDRESS] THESE ALL WORK FINE
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g'
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g' -e 's/[a-zA-Z :\r\n]*//g'
    curl http://checkip.dyndns.org/ | sed -e 's/<[^>]*>//g' -e 's/[a-zA-Z :\r\n]*//g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    curl http://checkip.dyndns.org/ | tr '' '\n' | grep '\.'
    curl http://checkip.dyndns.org/ | tr '' '\012' | grep '\.'
    curl http://checkip.dyndns.org/ | tr '' '\012' | grep '\.' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt ;
    curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' ' | sed -e 's/ //g'
    curl http://checkip.dyndns.org/ | tr '<[:alpha:]:/>' ' ' | sed -e 's/ //g' > ~/Desktop/IP_Address.txt ; open ~/Desktop/IP_Address.txt
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    SUMMARY : [PRIVATE ADDRESS] THIS WORKS FINE
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    ifconfig | grep broadcast | awk '{print $2 }'
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    SUMMARY : [PUBLIC & PRIVATE ADDRESS] THESE WORK FINE
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; ifconfig | grep broadcast | awk '{print $2 }'
    COPY CONTENT BETWEEN THE DASHED LINES AND PASTE IN THE TERMINAL
    curl http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' \
    ~/Desktop/IP_Address.txt ; \
    ifconfig | grep broadcast | awk '{print $2 }' \
    ~/Desktop/IP_Address.txt ; \
    open ~/Desktop/IP_Address.txt ;
    PROBLEM : I HAVE NO CLUE HOW TO GET RID OF THE THREE LINES:
    They were displayed by the terminal everytime I used a pipe, but I removed them for the sake of clarity
    Best Regards,
    Bill Hernandez
    Plano, Texas

    Thank You Very Much for enlightening me to the "-s" flag, that solved the problem...
    [2007.15.05](06:16PM) -> [username] ~ $ curl -s http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g'
    45.xxx.46.204
    ( 1 ) Sure enough I was missing the "-s" flag, I kept thinking it was something to do with the pipes because if I just entered
    [2007.15.05](06:21PM) -> [username] ~ $ curl http://checkip.dyndns.org
    <html><head><title>Current IP Check</title></head><body>Current IP Address: 45.xxx.46.204</body></html>
    ( 2 ) It did not add the extra lines. They only appeared when I added a pipe. How bizarre...
    ( 3 ) Once I looked at the man pages the "-s" became more obvious. It is still odd...
    [2007.15.05](06:21PM) -> [username] ~ $ man curl
    -s/--silent
    Silent mode. Don't show progress meter or error messages. Makes Curl mute.
    If this option is used twice, the second will again disable mute.
    THIS SOLVES THE PROBLEM :
    [2007.15.05](06:21PM) -> [username] ~ $ \
    curl -s http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' ; ifconfig | grep broadcast | awk '{print $2 }'
    ANYWAY HERE'S THE FINAL SCRIPT...
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    #!/bin/bash
    # ScriptName : myip
    # Author : Bill Hernandez
    # Location : Plano, Texas
    # Modified : Tuesday, May 15, 2007 (6:32 PM)
    curl -s http://checkip.dyndns.org/ | sed -e 's/[^0-9\.]*//g' > ~/Desktop/IP_Address.txt
    ifconfig | grep broadcast | awk '{print $2 }' >> ~/Desktop/IP_Address.txt
    if [ -d /Applications/BBEdit.app ]; then
    open -a /Applications/BBEdit.app ~/Desktop/IP_Address.txt
    else
    open ~/Desktop/IP_Address.txt
    fi
    -- ---------+---------+---------+---------+---------+---------+---------+---------
    Best Regards,
    Bill Hernandez
    Plano, texas

  • Export to text creates extra line

    I've created a number of fixed width extract reports that will be used to upload data into another system.  The files, in general, are fine, however Crystal Reports 2008 is adding an extra line to the end of the file.  This is causing the upload to fail.
    I've created several. extract reports before, so I reviewed a sample extract from a report I created in Crystal Reports XI R2 and it, too, had the same issue.
    Googling indicates that others have had the same issue, but I have yet to find a resolution to the problem.
    Has anybody else encountered this and do you know how to resolve the issue?
    Thank you, Kurt

    Hi Kurt,
    In my scheduler app I have a command line option to remove (or replace characters) in the resulting export file.  This was developed for exactly that reason (so there is a special option to remove/replace only the last character in the file).
    You can develop the same approach.  Alternatively, there are more direct upload options (the export can go directly into a database table).
    hth,
    - Ido

  • How to insert horizontal lines in alv report?

    hi,
        i have to insert horizontal lines in alv report.( RM07MLBB )
            actually my requirement is:
                               basis list = RM07MLBB.
    first secondary list = another report is called here ( RM07DOCS )
                      i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
    functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
        here in this program,
                        is_layout = alv_layout.
    hence i tried to give     
                  alv_layout-no_hline = ' '. 
    but not effecting.
              can some one please tell me , how to insert lines in the alv report.
    thanks in advance,
    Dastagir.

    hello,
         so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
           if same delivery challan number is repeating they should come in the same block,
    for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
                       in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED.

  • Insert specific line in an internal table at a specific place

    Hi
    i have an internal table (itab) let's say
    Name1 Name2 NUM1 NUM2 NUM3
    Which already populater with data.
    i have to do a subtotal for every NAME1 and insert a line just after the NAME1 in the internal table
    and another subtotal by every NAME1 NAME2 and insert a line just after every NAME1 and NAME2 in the internal table
    then another Grand total at the end of the table
    My psudeo code is a bit like that but the insert is done in the wrong row
    Index=1
    LOOP at itab index
    if itab-name1 NE old
      insert structure in itab index
    elseif itab-name1 NE old and itab-name2 NE old
      insert structure in itab index
    elseif itab EQ last line
      insert structure in itab index
    else
      structure-num1 = structure-num1 + itab-num1
      structure-num2 = structure-num2 + itab-num2
    endif
    index = index + 1
    endloop
    Do you think i need to use a temporary table here. can u guide me in code plz..

    sort internal table by name1 and name2. <b>Have name1 and name2 as the first two variables in the internal table</b>
    declare a work area and an internal table with the same structure as internal table.
    declare num1 as type itab-num1.
    num2 and i_num2 type itab-num2.
    sort itab by name1 and name2.
    loop the internal itab1.
    append itab1 to itab2.
    wa-num1 = structure-num1 + itab-num1
    wa-num2 = structure-num2 + itab-num2.
    i_num2 = i_num2 + itab-num2.
    num1 = num1 + itab-num1.
    num2 = num2 + itab-num2.
    at end of name2.
    append wa to itab2.
    clear wa_name2.
    endat.
    at end of name1.
    wa-num2 = i_num2.
    append wa to itab2.
    clear: i_num2, wa.
    endat.
    at last.
    wa-num1 = num1.
    wa-num2 = num2.
    append wa_itab2.
    endat.
    endloop.
    Thanks.

  • How to insert new line in the copied schema with transaction code PE01?

    Dear Experts,
             I have copied HKT0 to ZKT0 , i want to insert new line between  line 150 and line 160 in ZKT0, I don't know how to insert new line 160, who can tell me ?
             Looking forward to your reply.
    Best Regards,
    Merry

    Hi,
    1. Open your schema,
    2. In first colume "Line" select line where you want to add new line,
    3. Replace first value in the column field (that indicates number of line) with character I (means insert),
    4. Press enter
    The line will be added. The same way you can add lines to PCR.
    To delete use character D.
    Cheers

  • Not able to add extra line item in sales order - va01

    Hi friends,
    At the time of creation of sales order via va01.
    I am appending the my extra line item in xvbap. But on screen I am not able to view that extra line item.
    Could you please help me out with this problem.
    My code is given below.
    I am writting this code in MV45AFZB &
    in that FORM USEREXIT_CHECK_VBAP USING US_DIALOG.
    it_free_goods is the table in which i am having data which needs to be uploaded in xvbap.
      IF it_free_goods[] IS NOT INITIAL.
        LOOP AT it_free_goods INTO wa_free_goods.
          wa_xvbap-matnr = wa_free_goods-matnr.
          RV45A-MABNR  = wa_free_goods-matnr.
          VBAP-POSNR   = vbap-posnr + 10.
          wa_xvbap-kwmeng = wa_free_goods-menge.
          wa_xvbap-meins = wa_free_goods-meins.
          wa_xvbap-pstyv = co_pstyv.
          wa_xvbap-posnr = vbap-posnr + 10.
          wa_XVBAP-UPDKZ = 'I'.
          MOVE-CORRESPONDING wa_xvbap TO xvbap.
          APPEND xvbap.
         ENDLOOP.
       ENDIF.
    Please let me know if somethings needs to be changed.
    It will be very helpful for me,
    Thanks,
    Best Regards,
    Prashant

    Hi Prashanth,
    I believe the use of
    USEREXIT_CHECK_VBAP
    This user exit can be used to carry out additional checks (e.g. for completion) at item level
    Please check the following link which has a similar requirement
    Re: VA01/VA02  screen exit
    Regards
    Byju

Maybe you are looking for