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

Similar Messages

  • Problem while updating PO line item

    Hi,
    I am using ME_CONFIRMATION_UPDATE to update EKES table for mass PO confirmation and facing a problem . When we update it using the above FM used in our program after confirmation we are getting 2 records in transaction MD04 one for Shipping notification and other for PO item but when we confirm a PO manually
    then the PO item record gets replaced with shipping notification record.
    Thanks in advanced.

    Hi
    This is because the quantity reduced (RP) (field DABMG) in schedule line. You should update the field DABMG in EKET with quantity from your confirmation.
    Regards
    Dean Q.

  • 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

  • System is generated extra line item of G/L while clearing throgh F-44

    Dear Experts ,
    When we processing clearing through F-44 , system is generating one extra line item of G/L ,  due to this system is not allowing for clearing as the message " Posting is only possible with zero balance ; correct document " is served by system.
    Actually while clearing , i am including TDS clearing document (posted via F-54) also .
    please suggest.
    Thanks & Regards
    Shailesh

    Hi
    1. First of all i have given advance to vendor with deducting TDS (@10%) via F-48
    2. after that i have raised one invoice for same vendor with deducting TDS via FB60
    3. vendor TDS clearing via F-54
    4. now when i going for vendor clearing via F-44 with taking reference from above F-54 document
    i got below error :

  • 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.

  • 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

  • Problem while inserting into a table which has ManyToOne relation

    Problem while inserting into a table *(Files)* which has ManyToOne relation with another table *(Folder)* involving a attribute both in primary key as well as in foreign key in JPA 1.0.
    Relevent Code
    Entities:
    public class Files implements Serializable {
    @EmbeddedId
    protected FilesPK filesPK;
    private String filename;
    @JoinColumns({
    @JoinColumn(name = "folder_id", referencedColumnName = "folder_id"),
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Folders folders;
    public class FilesPK implements Serializable {
    private int fileId;
    private int uid;
    public class Folders implements Serializable {
    @EmbeddedId
    protected FoldersPK foldersPK;
    private String folderName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "folders")
    private Collection<Files> filesCollection;
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Users users;
    public class FoldersPK implements Serializable {
    private int folderId;
    private int uid;
    public class Users implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer uid;
    private String username;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "users")
    private Collection<Folders> foldersCollection;
    I left out @Basic & @Column annotations for sake of less code.
    EJB method
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    FoldersPK folderPk = new FoldersPK(folderID, uid);
         // My understanding that it should automatically handle folderId in files table,
    // but it is not…
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    It is giving error:
    Internal Exception: java.sql.SQLException: Field 'folderid' doesn't have a default value_
    Error Code: 1364
    Call: INSERT INTO files (filename, uid, fileid) VALUES (?, ?, ?)_
    _       bind => [hello.txt, 1, 0]_
    It is not even considering folderId while inserting into db.
    However it works fine when I add folderId variable in Files entity and changed insertFile like this:
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    file.setFolderId(folderId) // added line
    FoldersPK folderPk = new FoldersPK(folderID, uid);
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    My question is that is this behavior expected or it is a bug.
    Is it required to add "column_name" variable separately even when an entity has reference to ManyToOne mapping foreign Entity ?
    I used Mysql 5.1 for database, then generate entities using toplink, JPA 1.0, glassfish v2.1.
    I've also tested this using eclipselink and got same error.
    Please provide some pointers.
    Thanks

    Hello,
    What version of EclipseLink did you try? This looks like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=280436 that was fixed in EclipseLink 2.0, so please try a later version.
    You can also try working around the problem by making both fields writable through the reference mapping.
    Best Regards,
    Chris

  • 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

  • Problem while inserting a record to infotype 416

    Iam facing a problem while inserting a record to the infotype 416 for a personnel no using the FM 'HR_INFOTYPE_OPERATION'.I have created a FM to insert a record to the infotype 416.In that FM iam using the FM 'HR_INFOTYPE_OPERATION' to create a record for infotype 416.while executing  my FM the FM 'HR_INFOTYPE_OPERATION' is returning the return value 0.But when i check in PA30 for the infotype 416,there is no record created for that personnel no.Also in the table PA0416 the record is not get created.SO what might be the problem.can anyone please provide me help on this.
    I have attached the code of my FM for ur reference.
    FUNCTION Y_ESS_FL_ENCASH.
    DATA: G_COMPENSATION_AMOUNT LIKE PA0416-AMONT,
          G_RETURN TYPE BAPIRETURN1.
    DATA T_PA0416 LIKE P0416 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
           TCLAS                 = 'A'
           PERNR                 = '00000014'
           INFTY                 = '0416'
         BEGDA                 = sy-datum
         ENDDA                 =  sy-datum
           BYPASS_BUFFER         = 'X'
         LEGACY_MODE           = ' '
    IMPORTING
         SUBRC                 =
          TABLES
            INFTY_TAB             = T_PA0416
    EXCEPTIONS
      INFTY_NOT_FOUND       = 1
      OTHERS                = 2
        LOOP AT T_PA0416
        WHERE SUBTY = '1002'.
        ENDLOOP.
        IF SY-SUBRC <> 0.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
               NUMBER = '00000014'
            IMPORTING
               RETURN = G_RETURN.
          IF SY-SUBRC <> 0.
             MESSAGE I016(RP) WITH ' RECORD IS ALREADY LOCKED'.
          ENDIF.
          T_PA0416-PERNR = '00000014'.
          T_PA0416-SUBTY = '1002'.
          T_PA0416-INFTY = '0416'.
          T_PA0416-OBJPS = ''.
          T_PA0416-SPRPS = ''.
          T_PA0416-SEQNR = ''.
          T_PA0416-AEDTM = SY-DATUM.
          T_PA0416-UNAME = SY-UNAME.
          T_PA0416-ENDDA = SY-DATUM.
          T_PA0416-BEGDA = SY-DATUM.
          T_PA0416-NUMBR = '10'.
          T_PA0416-WGTYP = '1530'.
          T_PA0416-AMONT = '15000'.
          T_PA0416-WAERS = 'INR'.
          T_PA0416-QUONR = '1'.
          APPEND T_PA0416.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              INFTY                  = '0416'
              NUMBER                 = '00000014'
              SUBTYPE                = '1002'
      OBJECTID               =
      LOCKINDICATOR          =
             VALIDITYEND            = '31129999'
             VALIDITYBEGIN          = SY-DATUM
            RECORDNUMBER           = ''
              RECORD                 = T_PA0416
              OPERATION              = 'INS'
              TCLAS                  = 'A'
      DIALOG_MODE            = '0'
            NOCOMMIT               = 'X'
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
            IMPORTING
              RETURN                 = G_RETURN.
      KEY                    =
          IF G_RETURN+0(1) EQ 'E'.
                  MESSAGE I086(ZHR) WITH 'Record is not inserted in IT416'.
          ELSE.
              COMMIT WORK.
          ENDIF.
          CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
            EXPORTING
              NUMBER = '00000014'
            IMPORTING
              RETURN = G_RETURN.
        ENDIF.
    ENDFUNCTION.

    Hi Murthy
    With a first glance, I think you have given a wrong parameter value to "validityend". It should be '99991231' not '31129999' .
    If your problem still persists, try inserting the data online from PA30. If your input causes no errors, then please state what the return parameter contains.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • *insert new line item in sales order*

    Hi guys,
    I have requirment where, user would enter a material and system determines if free material is to be added to it. thats standard based on configuration.
    the user is maintaing ztable for additional free product for the material. now, i want to insert the third additional item along with other items. this has to be added before saving and it has to show on screen before user saves it.
    Thanks,
    Abhi.

    See, if u debug and enter the exit, then it shows 2 line item  in xvbap[] i.e. sale material and free material.
    now i want to add third add. free item. if insert in internal table xvbap[], it doesn't show on screen
    i want the solution for that.
    can anybody help me with that.

  • Insert new line item in va01&va02 - urgent

    Hi frndz,
    At the time of creation standard sales order using va01.
    When user enters the sold to party in header and then
    material & quantity in line item reocrds. After user enters the details in first line. I have some checks to be executed and on the basis of that customer will get the free material that should come on second line item.
    I am getting the details which i will be inserting on new line item but the problem is that in which exit i should write the code for the same.
    So frndz could you please let me know, in which userexit I should insert this new line item. There can be more than one free material.
    If anyone has done this already, please let me know.
    I know one exit i.e.MV45AFZB but in that there are many forms. so exactly which form i should where i will write the code to insert new line item???
    Points will be awarded surely.
    Regards,
    Prashant

    HI Stephen,
    I have the same prolem. I modified the 5 global tables, but I don't see the new line in the screen.
    Can you help me with some details?
    Thx!
    Mihaela

  • SKB1 is displaying unrelated/extra line items.

    Hi,
    I am encountering one problem which is related to KSB1 transaction. It's displaying extra line items which are not related to actual line items . Here is the scenario
    Actual Assessment Cycle contains one segment :
    Segment1 : Sender Cost Center group CG(C1,C2,C3,C4)1---All these cost centers are associated with functional area FA
    Cost element : 942XXXX
    Receiver Cost Center C5,C6,C7,C8----All these cost centers are associated with functional area FA.
    Amount $10
    After executing the assessment cycle when go to KSB1 it's displaying the following line items
    Doc No      Celement         Val in currency        Cost center     partner cost center    Ref Doc No    f unctional area     Posting date
    76942           942XXXX            $10                              C1                         C5                       76939        FA                       09/22/09
    76939           942XXXX           -$10                             C1                         C5                                         FA                       09/22/09
    76939           942XXXX            $0                               C1                          C5                                         FA1                     09/22/09
    76942           942XXXX            $0                               C1                          C5                        76939        FA1                    09/22/09
    I don't know why it's showing the line items which are realted to FA1 and these cost centers ARE assigned to functional area FA not to FA1.Does any one know from where it's pulling this information?Does any one know how it derives the functional area here. I don't know which table has this information(COEP,COEA,CCSS...?) How to fix this?
    I really appreciate your thoughts and input
    Thanks
    Br

    Hi Shekhar,
    What is happening in the system is standard SAP behaviour.. In case you do not want Down Payments to be updated in the system, please follow the steps below:-
    1. Create a new Field status group as a copy of G067 and make it say Z067(Assets field suppressed here) and assign it to Vendor related recon accounts(Spl GL A)
    2. After this, when you create a down payment request in F-47, you will receive an error message F5 378
    3. Go to transaction OBA5, enter work area as F5 and chnage the message no 378 to Warning (W)
    This setting will not generate additional line items.
    Regards,
    Kavita

  • Automatic Payment Run - Generate Extra line items

    Hi All,
    We need to create extra line items when automatic payment (F110) is run because we need sub-fund entries.
    For example:
    Automatic payment will create:
    Vendor a/c Dr.
    Unpresented Cheque a/c Cr.
    We need:
    Vendor a/c Dr.
    Sub-Fund a/c Dr.
    Unpresented Cheque a/c Cr.
    Sub-Fund a/c Cr.
    This is a requirement specific to our organisation. We need to add these extra line items while F110 is running and before document is posted. We have checked all the user-exits for transaction F110 and didn't find anything to add this.
    Any suggestions/ideas is highly appreciated.
    Regards,
    Sougata.

    Hi Sougata.
    Need to create Substitution rules (transaction OBBH) and within those rules you can define user exits (ZGGBS000 for e.g.). In those user exits, you can split the lines based on Document type (ZP, ZV) for automatic payment clearing.
    This is a customization + ABAP intensive approach, but is a approach that is supported by SAP and I have used it in the past to split document lines at any stage in their processing. It has been a while though and I don't have any examples to give you.
    Hope that helps!
    Rishi

  • Insert new line items in Delivery

    Hello All,
    Is there any BAPI or FM in which i can add new line item in SD delivery vl01n? The new line item will not be there in SO , but i want it in delivery. Manually i can insert new line item using VL01n , but i need FM to do the same.
    Thanks

    Hello,
    I need a Bapi or FM through which i can add new line item in delivery , maybe while creation of delivery or changing the delivery i.e. via VL01n or Vl02n. The new item will not be there in SO. It is a non valuated material.
    Helpful answers will be rewarded.
    Thank you

  • Issue while clearing open line items

    Hi team,
    While clearing open line items for vendors, customers, and GL's system is posting new line items. It should post without new line items. Example
    Customer is having debit and credit line items with same amount i am going to clearing manually thru f-32 here sytem is posting new document with new line items. It should post without line items. I have selected Negetive postings permited check box in OBY6. I have not selected check box in document types. Do i need to change in document type also or i missed anything in settings pls help me to overcome this issue.
    Regards,
    Nagaraju.

    Dear:
                        The option  to create a clearing document WITH or WITHOUT line items depend on the fields of the structure KONTAB_1ST if all the fields are equal in the documents the clearing document will be generated and posted without line items
    Please check OSS note 95077. Check the settings in
    IMG >Financial Accounting (New) >General Ledger Accounting (New) >
    Business Transactions >Document Splitting >Activate Document Splitting
    Check the following link for the same
    F.13 clearing Document contains Lineitems
    Regards

Maybe you are looking for