Using BAPI_REQUISITION_CREATE

hi all,
please tell me how to upload data using BAPI_REQUISITION_CREATE 
send me coding to understand myself .plz don't send link
Thanks in advance.
gupt

REPORT ZV1_BAPI_PR .
data:wa_eban like eban.
DATA: BEGIN OF itab OCCURS 0,
bsart(4),
."Purchase requisition document type
werks(4),
Plant
txz01(40),
."Short text
menge(13),
."Purchase requisition quantity
meins(3),
."Purchase requisition unit of measure
eeind(10),
."Item delivery date
wgbez(9),
."Material Group
name1(4),
."Plant
ekgrp(3),
."Purchasing Group
afnam(12),
."Name of requisitioner/requester
bednr(10),
."Requirement Tracking Number
knttp(1),
."Account assignment category
sakto(10),
."G/L Account Number
ps_posid(8),
."Work Breakdown Structure Element (WBS Element)
editor(132),
."Text line
END OF itab.
DATA: itab_bapiebanc LIKE bapiebanc OCCURS 0 WITH HEADER LINE.
DATA: itab_bapiebkn LIKE bapiebkn OCCURS 0 WITH HEADER LINE.
DATA: itab_bapiebantx LIKE bapiebantx OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF errmsg OCCURS 10.
INCLUDE STRUCTURE bapiret2.
DATA: END OF errmsg.
DATA: errflag.
select single * from eban
into wa_eban.
if sy-subrc = 0.
move-corresponding wa_eban to itab.
append itab.
clear itab.
endif.
*CALL FUNCTION 'UPLOAD'
EXPORTING
filename = 'C:\Documents and Settings\sap\Desktop\New Text Document (2).txt'
filetype = 'DAT'
TABLES
data_tab = itab.
*if sy-subrc 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
*endif.
LOOP AT itab.
itab_bapiebanc-doc_type = itab-bsart.
itab_bapiebanc-short_text = itab-txz01.
itab_bapiebanc-quantity = itab-menge.
itab_bapiebanc-unit = itab-meins.
if not itab-eeind is initial.
itab_bapiebanc-deliv_date = itab-eeind.
else.
itab_bapiebanc-deliv_date = sy-datum + 30.
endif.
itab_bapiebanc-plant = itab-werks.
itab_bapiebanc-pur_group = itab-ekgrp.
itab_bapiebanc-preq_name = itab-afnam.
itab_bapiebanc-trackingno = itab-bednr.
itab_bapiebanc-mat_grp = itab-wgbez.
itab_bapiebanc-acctasscat = itab-knttp.
itab_bapiebanc-acctasscat = 'A'.
itab_bapiebkn-g_l_acct = itab-sakto.
itab_bapiebkn-wbs_elem = itab-ps_posid.
itab_bapiebantx-text_line = itab-editor.
itab_bapiebantx-text_line = 'Test for Purchase requisiton'.
APPEND itab_bapiebkn.
APPEND itab_bapiebanc.
APPEND itab_bapiebantx.
ENDLOOP.
CALL FUNCTION 'BAPI_REQUISITION_CREATE'
TABLES
requisition_items = itab_bapiebanc
requisition_account_assignment = itab_bapiebkn
requisition_item_text = itab_bapiebantx
return = errmsg.
LOOP AT errmsg.
IF errmsg-type EQ 'E'.
WRITE:/'Error in function', errmsg-message.
errflag = 'X'.
ELSE.
WRITE:/ errmsg-message.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*loop at itab_bapiebanc.
*write:/ itab_bapiebanc-doc_type,
itab_bapiebanc-short_text,
itab_bapiebanc-quantity,
itab_bapiebanc-unit ,
itab_bapiebanc-deliv_date,
itab_bapiebanc-plant,
itab_bapiebanc-pur_group,
itab_bapiebanc-preq_name,
itab_bapiebanc-trackingno,
itab_bapiebanc-mat_grp,
100 itab_bapiebanc-acctasscat.
*endloop.
*loop at itab_bapiebkn.
write:/ itab_bapiebkn-g_l_acct,
itab_bapiebkn-wbs_elem.
*endloop.
*loop at itab_bapiebantx.
*write:/ itab_bapiebantx-text_line.
*endloop.

Similar Messages

  • PR created using ME51N Vs. PR created using BAPI_REQUISITION_CREATE - Probl

    Hello
    When I create a purchase requisition manually using ME51N with item category L, the Components of the material are automatically been exploded. If you just press the components tab of the Material Data tab, we can see the components of the material
    But, when I create a PR using BAPI_REQUISITION_CREATE with the same data of the previous PR, then the component tab has no information at all.  But If I press the Explode BOM, then I am getting the components. I need the components without exploding BOM as in the case of manual creation of  a PR.
    Do i need to pass any specific data in the BAPI to get the components ? Any help on this will be highly appriciated.
    Thanks & Regards
    Venktachalam .R

    please read note 499627. the bapi you are using is not capable of exploding your bom. the explosion is done when you use ME57 on that PR.

  • PR creation using BAPI_REQUISITION_CREATE, Service lines query

    Hi,
    I am trying to create the PR for service agreements and i'm able to create the same.
    My first query is how to populate the data in LIMIT tab(Overall Limit & Expected value) for each line item of PR. I am using BAPI_REQUISITION_CREATE but its not populating the values in LIMIT tab.
    2nd Query: BAPI_REQUISITION_CREATE is not checking the validity of the Requisitioner ID and even if the ID is not valis it is creating the PR. Does this BAPI_REQUISITION_CREATE restrict this? I guess it does not. I have created so many PR with invalid ID's while testing and it seems this bapi doesn't care about requisitioner id at all. Please advice some workaround.
    Appreciate your help.
    Thanks
    Randhir

    Solved.

  • Issue in creating limits value for service PR using BAPI_REQUISITION_CREATE

    HI Experts
    I am creating a service PR using bapi bapi_requisition_create.I am able to create service PR successfully, but I am not able to set value for overall limit and the Expected value.
    I am passing the limits values through bapi, but when I am trying to display those value in the limits tab in ME53N, it gives dump.
    Please suggest how can I set the limits value.
    regards
    Ashwini

    Could Ashwini or anyone else please suggest how this issue was resolved? I am using BAPI_REQUISITION_CREATE, but the limits I enter in the REQUISITION_LIMITS table, do not get saved, although the Purchase Requisition itself gets created.

  • Using BAPI_REQUISITION_CREATE has Error Message ME038 "No direct postings c

    I am using BAPI_REQUISITION_CREATE to create PR on Lotus Notes but there are Error Message ME038 "No direct postings can be made to G/L acct. XXXXX in CoCode XXXX".
    When I created PR in T-code ME51N on SAP, there are not this Error Message .
    I have checked G/L acct. in fs00, the Automatic Posting box is checked.
    How do I resolve this problem if the Automatic Posting box is still checked.

    Hello,
    Try passing the following fields in the table REQUISITION_ACCOUNT_ASSIGNMENT
    PREQ_NO   <blank it will be created>
    PREQ_ITEM <line item number>
    SERIAL_NO '01'
    Hope it helps...!
    Edited by: Anup Deshmukh on Jul 8, 2010 5:52 AM

  • PR Creation Using BAPI_REQUISITION_CREATE

    Hi,
    Iam using the RFC "BAPI_REQUISITION_CREATE" to create the Service PR . Iam entering the Service details in REQUISITION_SERVICES.
    PR is getting created but the Service line items are not filled.
    Please let me know which tables to be entered.
    Note: Iam using "BAPI_TRANSACTION_COMMIT"
    Thanks in Advance

    Dear,
    It is a generic problem while creating service PR using BAPI_REQUISITION_CREATE. For creating service PR using above function module follow  SAP note 420331
    Thanks and Regards,
    Chandra

  • Problem while using BAPI_REQUISITION_CREATE

    Hi Friends,
      i am working with BAPI_REQUISITION_CREATE for creating Purchase requisition.
    i used bapi and pass only basic parameters ..
    like
    i filled first parameter (item data) of  TAB Tables .
    Which are---
    item
    Doc_type = NB
    plant
    material
    qty
    requistioner name
    deliv_date
    purchase grp
    its working fine and returning value in importing parameter as
    PR number.But when i wrote a report and fill all parameters in
    my  report and try to display the NUMBER (PR number) then
    its not having any value in NUMBER Parameter but in data
    base its creating a PR.
    Can any one help me y its behaving differently ?

    date format prob

  • Urgent plz...Error: Multiple Account assignment in  BAPI_REQUISITION_CREATE

    Hi All,
    I'm using BAPI_REQUISITION_CREATE to create the PR . The PR is created successfully with service lines. The service lines for PR item has to be assigned to different account assignment. My problem is that account assignment is not getting assigned to the service line for multiple account assignment cases, instead the account assignment is blank for the sevice line.
    Here is part of my code.
    For Account Assignment
    t_requisitionaccoun-preq_item = '00010'.
    t_requisitionaccoun-serial_no = '01'.
    t_requisitionaccoun-g_l_acct = '0000630010'.
    t_requisitionaccoun-cost_ctr = '0801112560'.
    append t_requisitionaccoun
    t_requisitionaccoun-preq_item = '00010'.
    t_requisitionaccoun-serial_no = '02'.
    t_requisitionaccoun-cost_ctr = '0801111710'
    t_requisitionaccoun-g_l_acct = '0000610090'.
    append t_requisitionaccoun
    t_requisitionaccoun-preq_item = '00020'.
    t_requisitionaccoun-serial_no = '01'.
    t_requisitionaccoun-cost_ctr = '0801111710'
    t_requisitionaccoun-g_l_acct = '0000610090'.
    append t_requisitionaccoun
    For Service account Assignment
    *<b>PR item 10</b>
    Service item 1
    t_requisitionsrvaccass-pckg_no = '0000000002'.
    t_requisitionsrvaccass-line_no = 2. " line 1 is the header for service
    t_requisitionsrvaccass-serno_line = '01'.
    t_requisitionsrvaccass-quantity = '10'
    t_requisitionsrvaccass-serial_no = '01'
    APPEND t_requisitionsrvaccass.
    Service item 2
    t_requisitionsrvaccass-pckg_no = '0000000002'.
    t_requisitionsrvaccass-line_no = 3.
    t_requisitionsrvaccass-serno_line = '01'.
    t_requisitionsrvaccass-quantity = '10'
    t_requisitionsrvaccass-serial_no = '02'
    APPEND t_requisitionsrvaccass.
    *<b>PR item 20</b>
    Service item 1
    t_requisitionsrvaccass-pckg_no = '0000000004'.
    t_requisitionsrvaccass-line_no = 2. " line 1 is the header for service
    t_requisitionsrvaccass-serno_line = '01'.
    t_requisitionsrvaccass-quantity = '10'
    t_requisitionsrvaccass-serial_no = '01'
    APPEND t_requisitionsrvaccass.
    With this code, what I get is the blank account assignment for PR item 10 and correctly filled account assignment for PR item 20.
    Does anyone done this before and can give me some help. Thanks.

    Hi, can you send me an example of this BAPI.
    I have the same requeriment, i'm new with bapis
    thanks

  • ERROR IN BAPI_REQUISITION_CREATE

    E 06138 NOT POSSIBLE TO DETERMINE  A CONSUMPTION ACCOUNT ERROR IS COMING WHEN I AM USING BAPI_REQUISITION_CREATE, IN THE ACCOUNT ASSIGNMENT
    pLEASE rEPLY.
    NEERAJ.

    HI
       I guess the process is unable to determine the account for posting. Try to create a PR online and see if the same error encounters. If yes, request your functional consultant to help do the setup for the same.
    Kind Regards
    Eswar

  • Create Purchase Order with reference to Purchase Requisition using BAPI's

    Hello Experts,
    I need to create a Purchase order with reference to a Purchase Requisition.
    All the above has to be done by using BAPI's.
    For creating PR, I am using BAPI_REQUISITION_CREATE.
    and for PO, I am using BAPI_PO_CREATE.
    I am not able to use the requistion number in the PO. BAPI throws the following exception
    "Requisition 1014396 00010 not selectable"
    "Document contains no items"
    Query's:
    1. Do I need to release the PR for using it in PO?
    2. If so how can I work with the "BAPI_REQUISITION_RELEASE_GEN" to release PR?
    I have tried using the BAPI getting the following error "Release outside filed of responsibility".
    Please help I am in critical Postion...
    Thanks,
    Suma

    Hi Meenakshi,
    When, I try to release error I am getting the following the error " Purchase Requisition can not be released".
    Is this problem because of authorization or data issue?
    Thanks
    Suma

  • BAPI_REQUISITION_CREATE - Java (JCo) problem

    Hi all,
    Iam trying to create a purchase requistion using BAPI_REQUISITION_CREATE by using Java (JCo) programming. The problem i face is on the REQUISITION_ITEM_TEXT table. passing value text for "B01" successfully stored into SAP. but the problem is on "B02" field. No value stored into SAP (field not blank). Anyone can help me to solve this problem ?.
    Thanks in advance 
    [email protected]
    REQUISITION_ITEM_TEXT -
    docDesc = function.getTableParameterList().getTable ("REQUISITION_ITEM_TEXT");
    docDesc.appendRow ();
    docDesc.setValue (itemDetails.getId(), "PREQ_ITEM");
    docDesc.setValue ("B01", "TEXT_ID");
    docDesc.setValue ("*", "TEXT_FORM");
    System.out.println("MATERIAL DESCRIPTION : "+itemDetails.getMaterialDescription());
    docDesc.setValue (itemDetails.getMaterialDescription(), "TEXT_LINE");
    docDesc.appendRow ();
    docDesc.setValue (itemDetails.getId(), "PREQ_ITEM");
    docDesc.setValue ("BO2", "TEXT_ID");
    docDesc.setValue ("*", "TEXT_FORM");
    docDesc.setValue (prValue.getJustificationText(), "TEXT_LINE");

    Hi all,
    Iam trying to create a purchase requistion using BAPI_REQUISITION_CREATE by using Java (JCo) programming. The problem i face is on the REQUISITION_ITEM_TEXT table. passing value text for "B01" successfully stored into SAP. but the problem is on "B02" field. No value stored into SAP (field not blank). Anyone can help me to solve this problem ?.
    Thanks in advance 
    [email protected]
    REQUISITION_ITEM_TEXT -
    docDesc = function.getTableParameterList().getTable ("REQUISITION_ITEM_TEXT");
    docDesc.appendRow ();
    docDesc.setValue (itemDetails.getId(), "PREQ_ITEM");
    docDesc.setValue ("B01", "TEXT_ID");
    docDesc.setValue ("*", "TEXT_FORM");
    System.out.println("MATERIAL DESCRIPTION : "+itemDetails.getMaterialDescription());
    docDesc.setValue (itemDetails.getMaterialDescription(), "TEXT_LINE");
    docDesc.appendRow ();
    docDesc.setValue (itemDetails.getId(), "PREQ_ITEM");
    docDesc.setValue ("BO2", "TEXT_ID");
    docDesc.setValue ("*", "TEXT_FORM");
    docDesc.setValue (prValue.getJustificationText(), "TEXT_LINE");

  • Problems with bapi_requisition_create

    Hi,
    I am using BAPI_REQUISITION_CREATE to create new purchase requisition with services. Everything is OK as long as I create one PR. When go into sequential processing and try to create several (actually 2 is enough ) PRs I get and error message concerning lacking cost assignment in a service position. Obviously this message is wrong. What I discovered is that when I go into this BAPI for the second time (not having left the program) the function module still carries package numbers from previous run - and this is what causes the error. Still I do not know how to go around this. Did any of you come across this problem? Thanks for any help.
    Greg

    Hello,
    Welcome to SDN.
    I think ur code will be like this.
    loop at itab.
    call BAPI
    endloop.
    " U refesh all the internal table which u r passing it to BAPI at the beginning or at the end of the loop
    VAsanth

  • BAPI_REQUISITION_CREATE : Unit Of Measurment Issue

    Hello,
    I am trying to create PR by using BAPI_REQUISITION_CREATE.
    While creating PR I am facing a issue. I am not able to pass Unit of Measurment.
    Can anybody plz help me how to pass UOM using this Bapi.
    Thanks & Regards,
    Nikita

    *& Report  ZSOPR
    REPORT  ZSOPR.
    TABLES : VBAK, VBAP, VBEP, VBPA, VBKD, mara.
    DATA :  PREQ_NO LIKE BAPIEBANC-PREQ_NO,
            BAPIEBANC LIKE   BAPIEBANC OCCURS 0 WITH HEADER LINE,
            RETURN LIKE BAPIRETURN OCCURS 0 WITH HEADER LINE.
    DATA :IT_VBAK LIKE TABLE OF VBAK WITH HEADER LINE.
    DATA : TEXT1(38) TYPE C.
    DATA : INDICATOR.
    DATA: BEGIN OF ERROR_MESSAGE_TEMP OCCURS 0.
            INCLUDE STRUCTURE BAPIRETURN.
    DATA:END OF ERROR_MESSAGE_TEMP.
    DATA: BEGIN OF ERROR_MESSAGE OCCURS 0,
              SPACE1(5) TYPE C,
              TYPE TYPE BAPIRET2-TYPE,
              SPACE2(5) TYPE C,
              NUMBER TYPE BAPIRET2-NUMBER,
              SPACE3(5) TYPE C,
              MESSAGE TYPE BAPIRET2-MESSAGE,
              END OF ERROR_MESSAGE.
    DATA: BEGIN OF ERROR_MESSAGE_TEMP2 OCCURS 0,
              SPACE1(5) TYPE C,
              TYPE TYPE BAPIRET2-TYPE,
              SPACE2(5) TYPE C,
              NUMBER TYPE BAPIRET2-NUMBER,
              SPACE3(5) TYPE C,
              MESSAGE TYPE BAPIRET2-MESSAGE,
              END OF ERROR_MESSAGE_TEMP2.
    401231536
    SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF TABLE IT_VBAK WHERE ERDAT ge '20091216' AND ( AUART EQ 'ZOR2' OR AUART EQ 'ZOR6' )
    and SPART eq '30'  and VSNMR_V eq ' '.
    and vbeln eq '0401231536'.
    LOOP AT IT_VBAK .
      CLEAR : INDICATOR.
      if it_vbak-vgbel ne  ' '.
        CLEAR : vbkd.
        SELECT SINGLE * FROM VBKD WHERE VBELN EQ IT_VBAK-VBELN.
        IF SY-SUBRC EQ 0 AND VBKD-BSARK EQ ' ' .
          INDICATOR = ' '.
        ELSE.
          INDICATOR = 'X'.
        ENDIF.
      endif.
      ON CHANGE OF IT_VBAK-VBELN.
        CHECK INDICATOR EQ ' ' .
        BAPIEBANC-PREQ_ITEM = '10'.
        CLEAR : VBAP.
        SELECT  * FROM VBAP WHERE VBELN EQ IT_VBAK-VBELN.
          CLEAR : VBEP.
          SELECT SINGLE * FROM VBEP WHERE VBELN = VBAP-VBELN AND POSNR EQ VBAP-POSNR.
          CLEAR : VBPA.
          SELECT SINGLE * FROM VBPA WHERE VBELN EQ VBAP-VBELN AND PARVW EQ 'VE'.
          BAPIEBANC-DOC_TYPE = 'NB'.
          BAPIEBANC-PREQ_NAME = VBPA-PERNR.
          BAPIEBANC-ITEM_CAT = '7'.
          BAPIEBANC-SUPPL_PLNT = 'UHVC'.
          BAPIEBANC-STORE_LOC = 'FG01'.
          BAPIEBANC-PLANT = VBAP-WERKS.
          BAPIEBANC-MATERIAL = VBAP-MATNR.
          BAPIEBANC-PUR_GROUP = 'LOG'.
    clear : mara.
    select SINGLE * from mara where matnr = VBAP-MATNR.
    DATA : A LIKE EKPO-MENGE.
    A =  VBAP-KWMENG.
          CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
            EXPORTING
              I_MATNR                    =  VBAP-MATNR
              I_IN_ME                    =  VBAP-VRKME
              I_OUT_ME                   = MARA-MEINS
             I_MENGE                    =   VBAP-KWMENG
              I_MENGE                    =   A
    IMPORTING
       E_MENGE                    =  A
    EXCEPTIONS
      ERROR_IN_APPLICATION       = 1
      ERROR                      = 2
      OTHERS                     = 3
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    ******DATA : BAMNG LIKE BAPIEBANC-QUANTITY.
    ******BAMNG = VBAP-KWMENG.
    ******DATA: BAMEI LIKE BAPIEBANC-UNIT.
    ******BAMEI  = BAPIEBANC-UNIT.
         BAPIEBANC-QUANTITY = BAMNG.
         BAPIEBANC-UNIT =  VBAP-VRKME.  " CHN
         BAPIEBANC-UNIT =  BAMEI .  " CHN
         BAPIEBANC-QUANTITY = VBAP-KWMENG.
          BAPIEBANC-QUANTITY = A.
         BAPIEBANC-UNIT =  VBAP-VRKME.  " CHN
          BAPIEBANC-UNIT =  MARA-MEINS.  " CHN
          BAPIEBANC-DELIV_DATE = VBEP-EDATU.
          BAPIEBANC-TRACKINGNO = VBAP-VBELN.
          APPEND BAPIEBANC.
          BAPIEBANC-PREQ_ITEM = BAPIEBANC-PREQ_ITEM + 10.
        ENDSELECT.
        PERFORM S2.
        CLEAR : BAPIEBANC, TEXT1.
        REFRESH : BAPIEBANC.
      ENDON.
    ENDLOOP.
    *&      Form  S2
          text
    FORM S2.
      CALL FUNCTION 'BAPI_REQUISITION_CREATE'
        EXPORTING
          SKIP_ITEMS_WITH_ERROR                =
          AUTOMATIC_SOURCE                     = 'X'
       IMPORTING
         NUMBER                               = PREQ_NO
        TABLES
          REQUISITION_ITEMS                    = BAPIEBANC
          REQUISITION_ACCOUNT_ASSIGNMENT       =
          REQUISITION_ITEM_TEXT                =
          REQUISITION_LIMITS                   =
          REQUISITION_CONTRACT_LIMITS          =
          REQUISITION_SERVICES                 =
          REQUISITION_SRV_ACCASS_VALUES        =
         RETURN                               = RETURN
          REQUISITION_SERVICES_TEXT            =
          REQUISITION_ADDRDELIVERY             =
          EXTENSIONIN                          =
       LOOP AT RETURN.
    *BREAK-POINT.
         ENDLOOP.
      ERROR_MESSAGE_TEMP[] = RETURN[].
      CLEAR : text1.
      LOOP AT ERROR_MESSAGE_TEMP WHERE TYPE EQ 'I'.
        ERROR_MESSAGE-SPACE1 = ''.
        ERROR_MESSAGE-TYPE = ERROR_MESSAGE_TEMP-TYPE.
        ERROR_MESSAGE-SPACE2 = ''.
        ERROR_MESSAGE-NUMBER = ERROR_MESSAGE_TEMP-LOG_NO.
        ERROR_MESSAGE-SPACE3 = ''.
        ERROR_MESSAGE-MESSAGE = ERROR_MESSAGE_TEMP-MESSAGE.
        APPEND  ERROR_MESSAGE.
        TEXT1 = ERROR_MESSAGE_TEMP-MESSAGE.
      ENDLOOP.
      LOOP AT ERROR_MESSAGE_TEMP WHERE TYPE EQ 'E'.
        ERROR_MESSAGE_TEMP2-SPACE1 = ''.
        ERROR_MESSAGE_TEMP2-TYPE = ERROR_MESSAGE_TEMP-TYPE.
        ERROR_MESSAGE_TEMP2-SPACE2 = ''.
        ERROR_MESSAGE_TEMP2-NUMBER = ERROR_MESSAGE_TEMP-LOG_NO.
        ERROR_MESSAGE_TEMP2-SPACE3 = ''.
        ERROR_MESSAGE_TEMP2-MESSAGE = ERROR_MESSAGE_TEMP-MESSAGE.
        APPEND  ERROR_MESSAGE_TEMP2.
        ERROR_MESSAGE_TEMP-MESSAGE = it_vbak-vbeln.
        ERROR_MESSAGE_TEMP2-SPACE1 = ''.
        ERROR_MESSAGE_TEMP2-TYPE = ERROR_MESSAGE_TEMP-TYPE.
        ERROR_MESSAGE_TEMP2-SPACE2 = ''.
        ERROR_MESSAGE_TEMP2-NUMBER = ERROR_MESSAGE_TEMP-LOG_NO.
        ERROR_MESSAGE_TEMP2-SPACE3 = ''.
        ERROR_MESSAGE_TEMP2-MESSAGE = ERROR_MESSAGE_TEMP-MESSAGE.
        APPEND  ERROR_MESSAGE_TEMP2.
      ENDLOOP.
      IF RETURN-TYPE NE 'E'.
        IF NOT PREQ_NO IS INITIAL.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
             WAIT          = 'X'
              IMPORTING
                RETURN        = RETURN
      01.12.2009    **************
          CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
            EXPORTING
              ENDPOS_COL         = 80
              ENDPOS_ROW         = 10
              STARTPOS_COL       = 1
              STARTPOS_ROW       = 1
              TITLETEXT          = 'PR CREATED WITH FOLLOWING MESSAGES'
    IMPORTING
      CHOISE             =
            TABLES
              VALUETAB           =  ERROR_MESSAGE
           EXCEPTIONS
             BREAK_OFF          = 1
      OTHERS             = 2
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          MESSAGE I001(001) WITH RETURN-LOG_NO RETURN-MESSAGE.
    end of comment  ***************
          IF SY-SUBRC = 0.
            text1 =   text1+28(10).
            clear : vbak.
            SELECT * FROM VBAK WHERE VBELN = IT_VBAK-VBELN.     " 16.12.2009
              VBAK-VSNMR_V = TEXT1.
              MODIFY VBAK.
            ENDSELECT.
          endif.
        ENDIF.
      ELSE.
        CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
    EXPORTING
    ENDPOS_COL         = 80
    ENDPOS_ROW         = 10
    STARTPOS_COL       = 1
    STARTPOS_ROW       = 1
    TITLETEXT          = 'PR NOT CREATED :: FOLLOWING ERRORS:-'
    IMPORTING
      CHOISE             =
    TABLES
    VALUETAB           =  ERROR_MESSAGE_TEMP2
    EXCEPTIONS
    BREAK_OFF          = 1
      OTHERS             = 2
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        MESSAGE E001(001) WITH RETURN-LOG_NO RETURN-MESSAGE.
             ENDIF.
        REFRESH:ERROR_MESSAGE_TEMP2,ERROR_MESSAGE,RETURN,ERROR_MESSAGE_TEMP.
        CLEAR:ERROR_MESSAGE_TEMP2,ERROR_MESSAGE,RETURN,ERROR_MESSAGE_TEMP.
      ENDIF.
    *REFRESH:HEADER.
         CLEAR : HEADER.
      REFRESH:ERROR_MESSAGE_TEMP2,ERROR_MESSAGE,RETURN,ERROR_MESSAGE_TEMP.
         I_ITEM, I_PARTNERS, I_SCHEDULE.
      CLEAR:ERROR_MESSAGE_TEMP2,ERROR_MESSAGE,RETURN,ERROR_MESSAGE_TEMP.
         I_ITEM, I_PARTNERS, I_SCHEDULE.
    ENDFORM .                    "S2

  • Using BAPI_PR_CREATE , but failed to overwrite the item short text

    As I want to create PR items and rewrite the items' short text,
    even if i have give the short_text some  values ,
    but it still to be the default value after the PR items created.
    The following is main part of my program using BAPI  'BAPI_PR_CREATE' to create PR:
         w_pritem-material = t_in-matnr.
          perform frm_add_zero using w_pritem-material.
         W_PRITEM-PREQ_ITEM = SY-TABIX.
          w_pritem-preq_item = l_tabix.
          perform frm_add_zero using w_pritem-preq_item.
          w_pritem-acctasscat = t_in-knttp.
          w_pritem-plant = t_in-werks.
         W_PRITEM-STORE_LOC = '1003'.
          w_pritem-quantity = t_in-menge.
          w_pritem-SHORT_TEXT = t_in-txz01.
          append w_pritem to t_pritem.
          w_pritemx-preq_item = w_pritem-preq_item.
          w_pritemx-material = 'X'.
          w_pritemx-preq_itemx = 'X'.
          w_pritemx-acctasscat = 'X'.
          w_pritemx-plant = 'X'.
         W_PRITEMX-STORE_LOC = 'X'.
          w_pritemx-quantity = 'X'.
            w_pritemx-SHORT_TEXT = 'X'.
          append w_pritemx to t_pritemx.
        call function 'BAPI_PR_CREATE'
            exporting
                prheader = w_prhead
                prheaderx = w_prheadx
            importing
                number =  l_prnum
            tables
                return =  t_return
                pritem =  t_pritem
                pritemx = t_pritemx
                praccount = t_praccount
                praccountx = t_praccountx
                pritemtext = t_pritemtext
    Ivan Yang

    Now I try to use 'BAPI_REQUISITION_CREATE'  to instead of 'BAPI_PR_CREATE'.
    But it still fail , it always give a error message like that 'No direct postings can be made to G/L acct.'.
    Pls note that the ACCTASSCAT is setted to be 'M' , and I am sure that all the data entries can generate a PR without problem
    while using 'BAPI_PR_CREATE'.
    Following is the main part of my program:
    PR_ITEM-DOC_TYPE   = T_in-BSART.
    PR_ITEM-PREQ_ITEM  = l_tabix.
    perform frm_add_zero using PR_ITEM-PREQ_ITEM.
      PR_ITEM-ACCTASSCAT = 'M' .
    PR_ITEM-MATERIAL = t_in-MATNR.
      perform frm_add_zero using PR_ITEM-MATERIAL.
          if t_in-txz01 is not initial.
            PR_ITEM-SHORT_TEXT = t_in-txz01.
          endif.
        PR_ITEM-QUANTITY  = T_IN-MENGE.
        PR_ITEM-DELIV_DATE = '20090801'. 
        PR_ITEM-PLANT  = T_IN-WERKS.
        PR_ITEM-PREQ_DATE = '20090801'.
        APPEND PR_ITEM.
        PR_ACCOUNT-PREQ_ITEM = PR_ITEM-PREQ_ITEM.
        PR_ACCOUNT-G_L_ACCT = T_IN-SAKNR.  
        PR_ACCOUNT-SERIAL_NO = 1.
         PR_ACCOUNT-CO_AREA =  'XXX'.
          PR_ACCOUNT-PREQ_QTY = t_in-MENGE.
          PR_ACCOUNT-sd_doc = t_in-vbeln.
          perform frm_add_zero using PR_ACCOUNT-sd_doc.
          PR_ACCOUNT-SDOC_ITEM = t_in-posnr.
          perform frm_add_zero using PR_ACCOUNT-SDOC_ITEM.
        APPEND PR_ACCOUNT.
        CLEAR PR_ACCOUNT.
         CLEAR PR_ITEM.
    CALL FUNCTION 'BAPI_REQUISITION_CREATE'
    EXPORTING
      SKIP_ITEMS_WITH_ERROR                =
      AUTOMATIC_SOURCE                     = 'X'
           IMPORTING
             NUMBER                               = l_prnum
            TABLES
              REQUISITION_ITEMS                    = PR_ITEM
              REQUISITION_ACCOUNT_ASSIGNMENT       = PR_ACCOUNT
              RETURN                               = PR_RETURN
    Ivan Yang

  • BAPI_REQUISITION_CREATE  for item text

    hi,
    I am using  BAPI_REQUISITION_CREATE for pr creation.
    I give multiple line items as input for REQUISITION_ITEMS,
    For each line item i enter the text entries in REQUISITION_ITEM_TEXT by using the text id as B01, B02,.. i am able to seperate the item_text,item_note.. ,
    My requirement is :For mutliple line items iam not able to seperate the requistion_item_text. It is getting appended to all the line items..
    How will i seperate the text item wise?
    Kind Regards
    Alfred

    Hi,
             follow instructions of OSS note 420331
    <b>Reward points</b>
    Regarsd

Maybe you are looking for

  • Requisition Change History - not showing all records from CDHDR/CDPOS

    Hello, When viewing the Item Changes for a requisition in ME53N, I don't always see all the records that are contained in tables CDHDR / CDPOS. The missing records are related to release strategies. Does anyone have any ideas why this happens? Thank

  • MAPI32.dll was not found

    After installing Adobe Reader X, I could not open it. I get error message "AcroRD32.exe - Unable to locate component. Application failed to start MAPI32.dll was not found. Re-installing application may fix this problem."

  • FB 4.7 Released Today: What does it include?

    In another discussion, it was posted that FB 4.7 was released today: http://www.adobe.com/products/flash-builder.html The site is not very clear about Flex. Does it include Flex? Which version? What about Air 3.5?

  • Citi EO office FAILURE

    applied for the Citi Simplicity card and was approved for sli of $1800, my lowest since the start of my credit journey. I want to turn it down but not sure. HELP

  • Using SE Phones in PMB - Is it possible?

    I have a Satio, and the videos it shoots will not be recognized on import through PMB, this is the most asinine and frustrating element to the software, I can organise, tag and view all my files from my Bloggie, HD-SR12 and my DCR-P200 but not my Sat