Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_CREATE1-Runtime error

Former Member
0 Kudos

Hi ,

I am getting the runtime error while creating the PO. if i run PO which has only one line item PO is creating sucessfully but if i run PO which has multiple items my program is getting the runtime error or dump i dont know why?

please hlep me out its v.urgent

Thanks,

Vikranth Khimavath

8 REPLIES 8

Former Member
0 Kudos

Providing info such as error description would help for better advices.

Maybe the code also.

Kind Regards

Eswar

0 Kudos

Hi Eswar,

This is the error desc iam getting.

Exception condition "FAILURE" raised.

Thanks

Vikranth khimavath

0 Kudos

NO Clues... Vikranth.

Can you post your code???

Kind Regards

Eswar

0 Kudos

REPORT z_po_create NO STANDARD PAGE HEADING

MESSAGE-ID z0lo_scm

LINE-SIZE 220

LINE-COUNT 65 .

TABLES : ekko,

ekpo.

*----


  • D A T A D E C L A R A T I O N S

*----


*--Type declaration to store data read from table EKKO.

TYPES : BEGIN OF t_ekko,

ebeln TYPE ekko-ebeln,

bukrs TYPE ekko-bukrs,

bsart TYPE ekko-bsart,

aedat TYPE ekko-aedat,

ernam TYPE ekko-ernam,

lifnr TYPE ekko-lifnr,

ekorg TYPE ekko-ekorg,

ekgrp TYPE ekko-ekgrp,

spras TYPE ekko-spras,

werks TYPE ekpo-werks,

END OF t_ekko.

*--Type declaration to store data read from table EKPO.

TYPES : BEGIN OF t_ekpo,

ebeln TYPE ekpo-ebeln,

ebelp TYPE ekpo-ebelp,

matnr TYPE ekpo-matnr,

werks TYPE ekpo-werks,

lgort TYPE ekpo-lgort,

menge TYPE ekpo-menge,

knttp TYPE ekpo-knttp,

matkl TYPE ekpo-matkl,

bednr TYPE ekpo-bednr,

afnam TYPE ekpo-afnam,

meins TYPE ekpo-meins,

bpumz TYPE ekpo-bpumz,

bpumn TYPE ekpo-bpumn,

netpr TYPE ekpo-netpr,

peinh TYPE ekpo-peinh,

webaz TYPE ekpo-webaz,

END OF t_ekpo.

TYPES : BEGIN OF t_head_item,

ebeln TYPE ekko-ebeln,

bukrs TYPE ekko-bukrs,

bsart TYPE ekko-bsart,

aedat TYPE ekko-aedat,

ernam TYPE ekko-ernam,

lifnr TYPE ekko-lifnr,

ekorg TYPE ekko-ekorg,

ekgrp TYPE ekko-ekgrp,

spras TYPE ekko-spras,

pincr TYPE ekko-pincr,

zterm TYPE ekko-zterm,

waers TYPE ekko-waers,

inco1 TYPE ekko-inco1,

inco2 TYPE ekko-inco2,

bedat TYPE ekko-bedat,

ebelp TYPE ekpo-ebelp,

txz01 TYPE ekpo-txz01,

matnr TYPE ekpo-matnr,

werks TYPE ekpo-werks,

lgort TYPE ekpo-lgort,

menge TYPE ekpo-menge,

knttp TYPE ekpo-knttp,

matkl TYPE ekpo-matkl,

bednr TYPE ekpo-bednr,

afnam TYPE ekpo-afnam,

meins TYPE ekpo-meins,

bpumz TYPE ekpo-bpumz,

bpumn TYPE ekpo-bpumn,

netpr TYPE ekpo-netpr,

peinh TYPE ekpo-peinh,

webaz TYPE ekpo-webaz,

mwskz TYPE ekpo-mwskz,

adrn2 TYPE ekpo-adrn2,

END OF t_head_item.

TYPES : BEGIN OF t_sucess,

ebeln TYPE ekko-ebeln,

END OF t_sucess.

TYPES : BEGIN OF t_ekko_ekpo,

ebeln TYPE ekko-ebeln,

lifnr TYPE ekko-lifnr,

inco1 TYPE ekko-inco1,

inco2 TYPE ekko-inco2,

zterm TYPE ekko-zterm,

ebelp TYPE ekpo-ebelp,

matnr TYPE ekpo-matnr,

END OF t_ekko_ekpo.

TYPES: BEGIN OF t_err_log,

ebeln TYPE ebeln, " Purchase order no.

bstpo TYPE bstpo, " Purchase order line item

etenr TYPE etenr, " Schedule line

err_val(20) TYPE c, " Error value

err_msg(100) TYPE c, " Error message

pogr_err(1) TYPE c, " If 'X' indicates PO creation error,

" else, indicates GR creation error

END OF t_err_log.

*-- Variables declarations.

DATA : v_ebeln TYPE ekko-ebeln, "PO Number

v_bsart TYPE ekko-bsart,

v_ekorg TYPE ekko-ekorg, "Purchasing Organization

v_ekgrp TYPE ekko-ekgrp, "Purchasing group

v_lifnr TYPE ekko-lifnr, "Vendor Number

v_werks TYPE ekpo-werks, "Plant

v_matnr TYPE ekpo-matnr, "Material Number

v_infnr TYPE ekpo-infnr. "Agreement

*-- Constants declarations.

CONSTANTS: c_bstyp TYPE ekpo-bstyp VALUE 'K',

c_bstyp1 TYPE ekpo-bstyp VALUE 'F',

c_x VALUE 'X'.

*----


  • D A T A D E C L A R A T I O N S FOR BAPI

*----


**-BAPI structure for Purchase Order Header Data

DATA : x_poheader TYPE bapimepoheader,

**-BAPI structure for Purchase Order Header Data (Change Toolbar)

x_poheaderx TYPE bapimepoheaderx,

**-BAPI structure for Purchase Order Item Data

x_poitem TYPE bapimepoitem,

**-BAPI structure for Purchase Order Item Data (Change Toolbar)

x_poitemx TYPE bapimepoitemx,

**-BAPI structure for messages

x_return TYPE bapiret2,

**-Structure for the error log

x_err_log TYPE t_err_log,

**-BAPI structure for Purchase Order Account assignment Data

x_poaccount TYPE bapimepoaccount,

**-BAPI structure for Purchase Order Account assignment

**-Data (Change Toolbar)

x_poaccountx TYPE bapimepoaccountx,

*ADDRESS

x_deliveryaddr TYPE bapimepoaddrdelivery.

**-BAPI internal table containing purchase order item

DATA : it_poitem TYPE STANDARD TABLE OF bapimepoitem,

**-BAPI internal table containing PO item data (Change Toolbar)

it_poitemx TYPE STANDARD TABLE OF bapimepoitemx,

**-BAPI Return table containing messages

it_return TYPE STANDARD TABLE OF bapiret2,

**-BAPI internal table containing Account Assignment Fields for PO

it_poaccount TYPE STANDARD TABLE OF bapimepoaccount,

**-BAPI internal table containing Account Assignment Fields

**-in Purchase Order (Change Toolbar)

it_poaccountx TYPE STANDARD TABLE OF bapimepoaccountx,

it_deliveryaddr TYPE STANDARD TABLE OF bapimepoaddrdelivery.

*----


  • I N T E R N A L T A B L E D E C L E R A T I O N S

*----


DATA: it_ekko TYPE STANDARD TABLE OF t_ekko WITH HEADER LINE,

it_ekko_dest TYPE STANDARD TABLE OF t_ekko WITH HEADER LINE,

it_ekpo TYPE STANDARD TABLE OF t_ekpo WITH HEADER LINE,

it_head_item TYPE STANDARD TABLE OF t_head_item WITH HEADER LINE,

it_ekko_ekpo TYPE STANDARD TABLE OF t_ekko_ekpo WITH HEADER LINE,

it_sucess TYPE STANDARD TABLE OF t_sucess WITH HEADER LINE,

it_contract TYPE STANDARD TABLE OF t_sucess WITH HEADER LINE,

**-Internal table containing error messages

it_err_log TYPE STANDARD TABLE OF t_err_log.

*----


  • S E L E C T I O N S C R E E N

*----


*-- Selection criteria

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS:s_ebeln FOR ekko-ebeln, "PO Number

s_bsart FOR ekko-bsart DEFAULT 'ZHBV', "PO Type

s_aedat FOR ekko-aedat DEFAULT sy-datum, "Creation Date

s_ekorg FOR ekko-ekorg, "Purchasing Organization

s_ekgrp FOR ekko-ekgrp, "Purchasing group

s_lifnr FOR ekko-lifnr, "Vendor Number

s_werks FOR ekpo-werks, "Plant

s_matnr FOR ekpo-matnr, "Material Number

s_infnr FOR ekpo-infnr. "Agreement

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS :p_bukrs LIKE ekko-bukrs DEFAULT '9040', "Company Code

p_werks LIKE ekpo-werks DEFAULT '7040', "Plant

p_ekorg LIKE ekko-ekorg DEFAULT '9040', "Purchasing Organization

p_ekgrp LIKE ekko-ekgrp DEFAULT '031', "Purchasing group

p_bsart1 LIKE ekko-bsart DEFAULT 'ZHIH'. "PO Type

SELECTION-SCREEN END OF BLOCK b2.

----


  • A T S E L E C T I O N - S C R E E N

----


AT SELECTION-SCREEN.

*-- Validating the Selection Screen inputs.

PERFORM validate_user_input.

----


  • S T A R T - O F - S E L E C T I O N

----


START-OF-SELECTION.

*-- Getting data from table EKKO.

PERFORM get_purchase_order.

*-- Getting data from table EKKO

PERFORM get_po_created.

*-- Getting data from table EKKO & EKPO

PERFORM get_contract_num.

*-- Creating the PO.

PERFORM create_po.

----


  • E N D - O F - S E L E C T I O N

----


END-OF-SELECTION.

*-- Display PO which are already created

PERFORM display_createdpo_rept.

*-- Display PO which doesnt have contract numbers

PERFORM display_contract_rept.

TOP-OF-PAGE.

PERFORM page_heading.

&----


*& Form VALIDATE_USER_INPUT

&----


  • Form to validate user inputs at Selection Screen.

----


FORM validate_user_input .

*-- Validating Purchasing Document Number

IF NOT s_ebeln[] IS INITIAL.

SELECT ebeln

INTO v_ebeln

FROM ekko

UP TO 1 ROWS

WHERE ebeln IN s_ebeln.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid Purchasing Document Number'(004).

ENDIF.

ENDIF.

*-- Validating Purchasing Document Type

IF NOT s_bsart[] IS INITIAL.

SELECT bsart

INTO v_bsart

FROM t161

UP TO 1 ROWS

WHERE bsart IN s_bsart.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid Purchasing Document Type'(005).

ENDIF.

ENDIF.

*-- Validating Purchasing org

IF NOT s_ekorg[] IS INITIAL.

SELECT ekorg

INTO v_ekorg

FROM t024e

UP TO 1 ROWS

WHERE ekorg IN s_ekorg.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid Purchasing Organization'(006).

ENDIF.

ENDIF.

*-- Validating Purchasing group

IF NOT s_ekgrp[] IS INITIAL.

SELECT ekgrp

INTO v_ekgrp

FROM t024

UP TO 1 ROWS

WHERE ekgrp IN s_ekgrp.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid Purchasing Group'(007).

ENDIF.

ENDIF.

*-- Validating Vendor's account number

IF NOT s_lifnr[] IS INITIAL.

SELECT lifnr

INTO v_lifnr

FROM lfa1

UP TO 1 ROWS

WHERE lifnr IN s_lifnr.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid Vendor account number'(008).

ENDIF.

ENDIF.

*-- Validating Plant

IF NOT s_werks[] IS INITIAL.

SELECT werks

INTO v_werks

FROM t001w

UP TO 1 ROWS

WHERE werks IN s_werks.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid Plant'(009).

ENDIF.

ENDIF.

*-- Validating Material

IF NOT s_matnr[] IS INITIAL.

SELECT matnr

INTO v_matnr

FROM mara

UP TO 1 ROWS

WHERE matnr IN s_matnr.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid Material Number'(010).

ENDIF.

ENDIF.

*-- Validating info record(Agreement)

IF NOT s_infnr[] IS INITIAL.

SELECT infnr

INTO v_infnr

FROM eina

UP TO 1 ROWS

WHERE infnr IN s_infnr.

ENDSELECT.

IF sy-subrc <> 0.

MESSAGE e000 WITH 'Invalid purchasing info record'(011).

ENDIF.

ENDIF.

ENDFORM. " VALIDATE_USER_INPUT

&----


*& Form GET_PURCHASE_ORDER

&----


  • Form to fetch data required from table EKKO & EKPO into internal table.

----


FORM get_purchase_order.

REFRESH it_head_item.

*-- Getting data from table EKKO & EKPO.

SELECT a~ebeln

a~bukrs

a~bsart

a~aedat

a~ernam

a~lifnr

a~ekorg

a~ekgrp

a~spras

a~pincr

a~zterm

a~waers

a~inco1

a~inco2

a~bedat

b~ebelp

b~txz01

b~matnr

b~werks

b~lgort

b~menge

b~knttp

b~matkl

b~bednr

b~afnam

b~meins

b~bpumz

b~bpumn

b~netpr

b~peinh

b~webaz

b~mwskz

b~adrn2

INTO TABLE it_head_item

FROM ekko AS a

INNER JOIN ekpo AS b

ON aebeln = bebeln

WHERE a~ebeln IN s_ebeln

AND a~bsart IN s_bsart

AND a~aedat IN s_aedat

AND a~ekgrp IN s_ekgrp

AND a~ekorg IN s_ekorg

AND a~lifnr IN s_lifnr

AND a~loekz <> c_x

AND b~werks IN s_werks

AND b~matnr IN s_matnr

AND b~infnr IN s_infnr

AND b~loekz <> c_x.

IF sy-subrc = 0.

SORT it_head_item BY ebeln.

LOOP AT it_head_item.

it_head_item-ebeln+0(1) = 'I'.

MODIFY it_head_item INDEX sy-tabix.

ENDLOOP.

ELSE.

MESSAGE i000 WITH 'No Purchase Order is possible for creation'(003).

STOP.

ENDIF.

ENDFORM. " GET_PURCHASE_ORDER

&----


*& Form GET_PO_CREATED

&----


  • Form to fetch data required from table EKKO into internal table.

  • Delete those records which are already created

----


FORM get_po_created .

*--fetch data from table EKKO into internal table

*--Where Docu type = 'ZHIH'

IF NOT it_head_item[] IS INITIAL.

SELECT a~ebeln

a~bukrs

a~bsart

a~aedat

a~ernam

a~lifnr

a~ekorg

a~ekgrp

a~spras

b~werks

INTO TABLE it_ekko_dest

FROM ekko AS a

INNER JOIN ekpo AS b

ON aebeln = bebeln

FOR ALL ENTRIES IN it_head_item

WHERE a~ebeln = it_head_item-ebeln

AND a~bsart = p_bsart1

AND a~bukrs = p_bukrs

AND b~werks = p_werks

AND b~bstyp = c_bstyp1

AND a~ekorg = p_ekorg

AND a~ekgrp = p_ekgrp.

IF sy-subrc = 0.

SORT it_ekko_dest BY ebeln.

ENDIF.

ENDIF.

*--Move all the PO numbers into sucess internal table

*--if the PO was already created

LOOP AT it_ekko_dest.

MOVE it_ekko_dest-ebeln TO it_sucess-ebeln.

APPEND it_sucess.

CLEAR it_sucess.

DELETE it_head_item WHERE ebeln = it_ekko_dest-ebeln.

ENDLOOP.

CLEAR it_head_item.

IF it_head_item[] IS INITIAL.

MESSAGE i000 WITH 'No Purchase Order is possible for creation'(003).

STOP.

ENDIF.

ENDFORM. " GET_PO_CREATED

&----


*& Form GET_CONTRACT_NUM

&----


  • text

----


FORM get_contract_num .

*--Select the data to get contract number

IF NOT it_head_item[] IS INITIAL.

SELECT a~ebeln "contract numbers

a~lifnr

a~inco1 "Incoterm1

a~inco2 "incoterm2

a~zterm

b~ebelp

b~matnr

INTO TABLE it_ekko_ekpo

FROM ekko AS a

INNER JOIN ekpo AS b

ON a~ebeln = b~ebeln

FOR ALL ENTRIES IN it_head_item

WHERE b~matnr = it_head_item-matnr

AND a~bukrs = p_bukrs " Company code

AND a~ekorg = p_ekorg " Purchase org

AND a~loekz <> c_x " Deletion indicator for header data

AND a~kdatb <= sy-datum " Validity period start

AND a~kdate >= sy-datum " Validity period end

AND b~loekz <> c_x " Deletion indicator for item data

AND b~bstyp = c_bstyp. " Purch. doc. category

IF sy-subrc = 0.

SORT it_ekko_ekpo BY matnr.

ENDIF.

LOOP AT it_head_item.

READ TABLE it_ekko_ekpo WITH KEY matnr = it_head_item-matnr

BINARY SEARCH.

IF sy-subrc <> 0.

*-- move the data to the internal table

*-- which doesnt have contract number

it_contract-ebeln = it_head_item-ebeln.

APPEND it_contract.

CLEAR it_contract.

*-- Deleting the record

*-- which doesnt have any contract number

DELETE it_head_item WHERE ebeln = it_head_item-ebeln.

ENDIF.

ENDLOOP.

CLEAR it_head_item.

ENDIF.

IF it_head_item[] IS INITIAL.

MESSAGE i000 WITH 'No Purchase Order is possible for creation'(003).

STOP.

ENDIF.

ENDFORM. " GET_CONTRACT_NUM

&----


*& Form CREATE_PO

&----


  • CREATE PURCHASE ORDER

----


FORM create_po .

DATA: l_ret_msg(1000) TYPE c. " Success/Error message from BAPI

CLEAR: x_poheader, x_poheaderx.

SORT it_head_item BY ebeln.

LOOP AT it_head_item.

AT NEW ebeln.

READ TABLE it_head_item WITH KEY ebeln = it_head_item-ebeln.

IF sy-subrc = 0.

**-Populate PO Header structure

x_poheader-po_number = it_head_item-ebeln. " PO no.

x_poheader-comp_code = p_bukrs. " Company code

x_poheader-doc_type = p_bsart1. " Document type

x_poheader-creat_date = it_head_item-aedat. " Date created

x_poheader-created_by = it_head_item-ernam. " Created by

READ TABLE it_ekko_ekpo WITH KEY matnr = it_head_item-matnr

BINARY SEARCH.

IF sy-subrc = 0.

x_poheader-vendor = it_ekko_ekpo-lifnr. " Vendor no.

x_poheader-incoterms1 = it_ekko_ekpo-inco1. " Incoterms1

x_poheader-incoterms2 = it_ekko_ekpo-inco2. " Incoterms2

x_poheader-pmnttrms = it_ekko_ekpo-zterm. " Payment terms

ENDIF.

x_poheader-langu = sy-langu. " Language key

x_poheader-langu_iso = sy-langu. " Language key iso

x_poheader-purch_org = p_ekorg. " Purchasing org.

x_poheader-pur_group = p_ekgrp. " Purch. Group

x_poheader-currency = it_head_item-waers. " currency

x_poheader-currency_iso = it_head_item-waers. " currency iso

x_poheader-doc_date = it_head_item-bedat. " Doc date

**-Populate PO Header 'X' structure

x_poheaderx-po_number = c_x.

x_poheaderx-comp_code = c_x.

x_poheaderx-doc_type = c_x.

x_poheaderx-creat_date = c_x.

x_poheaderx-created_by = c_x.

x_poheaderx-vendor = c_x.

x_poheaderx-langu = c_x.

x_poheaderx-langu_iso = c_x.

x_poheaderx-pmnttrms = c_x.

x_poheaderx-purch_org = c_x.

x_poheaderx-pur_group = c_x.

x_poheaderx-currency = c_x.

x_poheaderx-currency_iso = c_x.

x_poheaderx-doc_date = c_x.

x_poheaderx-incoterms1 = c_x.

x_poheaderx-incoterms2 = c_x.

ENDIF.

ENDAT.

READ TABLE it_ekko_ekpo WITH KEY matnr = it_head_item-matnr

BINARY SEARCH.

IF sy-subrc = 0.

x_poitem-po_item = it_ekko_ekpo-ebelp. " PO Item no.

x_poitem-agreement = it_ekko_ekpo-ebeln. " Agreement NO

ENDIF.

x_poitem-short_text = it_head_item-txz01. " Item description

x_poitem-material = it_head_item-matnr. " Material no.

x_poitem-plant = p_werks. " Plant

x_poitem-stge_loc = p_werks. " Storage Loc

x_poitem-matl_group = it_head_item-matkl. " Material group

x_poitem-quantity = it_head_item-menge. " Ordered qty.

x_poitem-po_unit = it_head_item-meins. " Order unit

x_poitem-po_unit_iso = it_head_item-meins. " Order unit

x_poitem-net_price = it_head_item-netpr. " Net price

x_poitem-price_unit = it_head_item-peinh. " price per unit

x_poitem-tax_code = it_head_item-mwskz. " Tax Code

x_poitem-acctasscat = it_head_item-knttp. " Account ass cata

APPEND x_poitem TO it_poitem.

CLEAR x_poitem.

**-Populate PO Item 'X' structure

x_poitemx-po_item = it_ekko_ekpo-ebelp. " PO Item no.

x_poitemx-po_itemx = c_x.

x_poitemx-short_text = c_x.

x_poitemx-material = c_x.

x_poitemx-plant = c_x.

x_poitemx-stge_loc = c_x.

x_poitemx-agreement = c_x.

x_poitemx-matl_group = c_x.

x_poitemx-quantity = c_x.

x_poitemx-po_unit = c_x.

x_poitemx-po_unit_iso = c_x.

x_poitemx-net_price = c_x.

x_poitemx-price_unit = c_x.

x_poitemx-tax_code = c_x.

x_poitemx-acctasscat = c_x.

APPEND x_poitemx TO it_poitemx.

CLEAR x_poitemx.

x_deliveryaddr-po_item = it_ekko_ekpo-ebelp.

x_deliveryaddr-addr_no = it_head_item-adrn2.

APPEND x_deliveryaddr TO it_deliveryaddr.

CLEAR x_deliveryaddr.

AT END OF ebeln.

CALL FUNCTION 'BAPI_PO_CREATE1'

EXPORTING

poheader = x_poheader

poheaderx = x_poheaderx

TABLES

return = it_return

poitem = it_poitem

poitemx = it_poitemx

poaddrdelivery = it_deliveryaddr.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

REFRESH : it_poitemx,it_poitem.

WRITE 😕 x_poheader-po_number.

LOOP AT it_return INTO x_return.

WRITE 😕 x_return-type,

20 x_return-message.

ENDLOOP.

REFRESH : it_poitemx,it_poitem,it_deliveryaddr,it_return.

CLEAR: x_poheader,x_poheaderx,x_poitem,x_poitemx,x_deliveryaddr.

ENDAT.

ENDLOOP.

ENDFORM. " CREATE_PO

&----


*& Form display_createdpo_rept

&----


  • text

----


FORM display_createdpo_rept .

**-Column headings

FORMAT COLOR COL_HEADING.

WRITE:/1(100) sy-uline.

WRITE:/1 sy-vline,

30 'List of PO already created',

100 sy-vline.

FORMAT INTENSIFIED OFF.

FORMAT RESET.

WRITE:/1(100) sy-uline.

*-- Display PO created sucess report

LOOP AT it_sucess.

WRITE:/1 sy-vline,

15 'Purchase Order NO:',

40 it_sucess-ebeln,

100 sy-vline.

ENDLOOP.

WRITE:/1 sy-vline,

2(99) sy-uline,

100 sy-vline.

ENDFORM. " display_createdpo_rept

&----


*& Form display_contract_rept

&----


  • text

----


FORM display_contract_rept .

SKIP 3.

**-Column headings

FORMAT COLOR COL_HEADING.

WRITE:/1(100) sy-uline.

WRITE:/1 sy-vline,

30 'List of Contract Numbers',

100 sy-vline.

FORMAT INTENSIFIED OFF.

FORMAT RESET.

WRITE:/1(100) sy-uline.

LOOP AT it_contract.

WRITE:/1 sy-vline,

15 'Purchase Order NO:',

40 it_contract-ebeln,

100 sy-vline.

ENDLOOP.

WRITE:/1 sy-vline,

2(99) sy-uline,

100 sy-vline.

ENDFORM. " display_contract_rept

*&----


**& Form RETURN_MESSAGES

*&----


    • text

*----


*FORM return_messages .

*

*

*ENDFORM. " RETURN_MESSAGES

&----


*& Form PAGE_HEADING

&----


  • text

----


FORM page_heading .

**-List heading

FORMAT COLOR COL_HEADING.

WRITE:/1(100) sy-uline.

WRITE:/1 sy-vline,

40 'Summary Report',

100 sy-vline.

FORMAT INTENSIFIED OFF.

FORMAT RESET.

WRITE:/1(100) sy-uline.

SKIP 5.

ENDFORM. " PAGE_HEADING

0 Kudos

Hi Vikranth

Please try to keep the process simple. In the sense, data which can be extracted internal by SAP from masters ignore the same.

Also do try by changing as below:

      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          POHEADER       = X_POHEADER
          POHEADERX      = X_POHEADERX
        TABLES
<b>          RETURN         = IT_RETURN[]
          POITEM         = IT_POITEM[]
          POITEMX        = IT_POITEMX[]
          POADDRDELIVERY = IT_DELIVERYADDR[].</b>

Kind Regards

Eswar

former_member193831
Active Participant
0 Kudos

Pls post the code for BAPI_PO_CREATE1-

Former Member
0 Kudos

Hi Vikranth Khimavath,

In the above code did u called the FM from patters, in the code i am unable to find the IMPORT parameters, you just check it out with the IMPORT parameters there should be a field PO number.

RAO

gknguyen
Explorer
0 Kudos

Hi,

Would you kindly provide the solution for this issue if you have one? I have the same situation and don't know how to resolve it.

Thanks