Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

doubt in extract program

hi,

i am trying to extract po from sap 4.7 using this code..

I am passing EKORG and lifnr as input..

but it is taking time to run..

i am not getting output

plz help me

*"Local interface:

*" IMPORTING

*" VALUE(I_EKORG) TYPE EKKO-EKORG OPTIONAL

*" VALUE(I_LIFNR) TYPE LFA1-LIFNR OPTIONAL

*" TABLES

*" LT_EKKO STRUCTURE ZPO_DATA_47 OPTIONAL

*" LT_EKPO STRUCTURE ZPO_ITEM_47 OPTIONAL

*" LT_EKET STRUCTURE ZPO_EKET_47 OPTIONAL

*" LT_ADRC STRUCTURE ZPO_ADRC_47 OPTIONAL

*" LT_EKKN STRUCTURE ZPO_EKKN_47 OPTIONAL

*" LT_EKBE STRUCTURE ZPO_EKBE_47 OPTIONAL

*" EXCEPTIONS

*" INVALID_PO

*" NOT_ORACLE_PO

*"----


  • Types declaration for PO history

TYPES : BEGIN OF ty_s_ekbe,

ebeln TYPE ekko-ebeln,

ebelp TYPE ekpo-ebelp,

menge TYPE ekpo-menge,

vgabe TYPE vgabe,

qty TYPE ekpo-menge,

END OF ty_s_ekbe.

data : it_ekbe type standard table of ty_s_ekbe.

  • Types declaration of Address data

TYPES: BEGIN OF ty_s_adrc,

adrnr TYPE ekko-adrnr,

END OF ty_s_adrc.

  • Tables

DATA: lt_tline_read TYPE STANDARD TABLE OF tline,

gt_adrc TYPE STANDARD TABLE OF ty_s_adrc,

gt_ekbe TYPE STANDARD TABLE OF ty_s_ekbe.

  • Local structures

DATA: ls_ekko TYPE zpo_data_47,

ls_ekpo TYPE zpo_item_47,

ls_adrc TYPE zpo_adrc_47,

ls_ekkn TYPE zpo_ekkn_47,

ls_tline TYPE tline,

ls_ekbe TYPE ty_s_ekbe.

  • Local variables

DATA: lv_adrnr TYPE adrnr,

lv_id TYPE thead-tdname,

lv_str TYPE stxh.

Data l_rec type I value 10000.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = i_lifnr

IMPORTING

OUTPUT = i_lifnr

.

*if not i_ekorg is INITIAL and not i_lifnr is INITIAL.

  • Select Purchasing Document Header data

  • ELSE.

SELECT ebeln

bukrs

bsart

lifnr

zterm

ekorg

ekgrp

waers

bedat

wkurs

inco1

inco2

  • ltex1

adrnr

FROM ekko

INTO TABLE lt_ekko package size l_rec

  • where ekorg = i_ekorg and lifnr eq i_lifnr.

WHERE bsart in ('OR1', 'OR2').

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question