Skip to Content
-4

cannot read values of BAPI Table

Jan 25 at 02:07 PM

51

avatar image
Former Member

Hi

am using the bellow ABAP code with BAPI_ALM_ORDER_GET_DETAIL to read all data for one order.

i can get data for export parameters but for export tables like (ET_OPERATIONS)
am getting 0 for all values


PARAMETER: ODR_NO LIKE BAPI_ALM_ORDER_HEADERS_I-ORDERID. " Order Number
"BAPI_ALM_ORDER_HEADERS_I-ORDERID

DATA: IT_HEADER LIKE BAPI_ALM_ORDER_HEADERS_I OCCURS 0 WITH HEADER LINE,


IT_OPERATION LIKE BAPI_ALM_ORDER_OPERATION OCCURS 0 WITH HEADER LINE,

" Input Structure for PM/CS BAPIs Operations

IT_OPERATION_UP LIKE BAPI_ALM_ORDER_OPERATION_UP OCCURS 0 WITH HEADER LINE,

" Update Structure for PM/CS BAPI Operations

IT_HEADER_SRV LIKE BAPI_ALM_ORDER_SRVDAT_E OCCURS 0 WITH HEADER LINE,

" Service-Specific Data, External Structure

IT_HEADER_SRV_UP LIKE BAPI_ALM_ORDER_SRVDAT_UP OCCURS 0 WITH HEADER LINE,

" Service-Specific Data, External Structure

IT_PARTNERS LIKE BAPI_ALM_ORDER_PARTN_MUL OCCURS 0 WITH HEADER LINE,

" Partner Data

IT_PARTNERS_UP LIKE BAPI_ALM_ORDER_PARTN_MUL_UP OCCURS 0 WITH HEADER LINE,

" Partner Data for Several Orders, Update

RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,

*Tables to get deatils for Order

ES_HEADER LIKE BAPI_ALM_ORDER_HEADER_E OCCURS 0 WITH HEADER LINE,

" Export Structure for ALM Order Header

ES_SRVDATA LIKE BAPI_ALM_ORDER_SRVDAT_E OCCURS 0 WITH HEADER LINE,

" ALM Order BAPIs: Service-Specific Data, External Structure

ET_PARTNER LIKE BAPI_ALM_ORDER_PARTNER OCCURS 0 WITH HEADER LINE,

" Partner Data for Several Orders

ET_OPERATIONS LIKE BAPI_ALM_ORDER_OPERATION_E OCCURS 0 WITH HEADER LINE,

" Export Structure for PM/CS BAPIs Operations

ET_COMP LIKE BAPI_ALM_ORDER_COMPONENT_E OCCURS 0 WITH HEADER LINE,

ET_RELATIONS LIKE BAPI_ALM_ORDER_RELATION_EXPORT OCCURS 0 WITH HEADER LINE,

" BAPI Structure for ALM Order Relationships

ET_TEXTS LIKE BAPI_ALM_TEXT OCCURS 0 WITH HEADER LINE,

" Text Header for ALM Order BAPIs

ET_TEXT_LINES LIKE BAPI_ALM_TEXT_LINES OCCURS 0 WITH HEADER LINE,

" Text Lines for ALM BAPIs

ET_PRTS LIKE BAPI_ALM_ORDER_PRT_E OCCURS 0 WITH HEADER LINE,

" Structure for Production Resources/Tools

ET_COSTS_SUM LIKE BAPI_ALM_ORDER_COSTS_SUM_E OCCURS 0 WITH HEADER LINE,

" Structure for Order Costs Sum

ET_COST_DET LIKE BAPI_ALM_ORDER_COSTS_DETAIL_E OCCURS 0 WITH HEADER LINE,

" Structure for Order Costs Detail

RETURN1 LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE

" Table for return messages

.

*Get deatils for Order

CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'

EXPORTING

NUMBER = ODR_NO

IMPORTING

ES_HEADER = ES_HEADER

ES_SRVDATA = ES_SRVDATA

TABLES

ET_PARTNER = ET_PARTNER

ET_OPERATIONS = ET_OPERATIONS

ET_COMPONENTS = ET_COMP

ET_RELATIONS = ET_RELATIONS

ET_TEXTS = ET_TEXTS

ET_TEXT_LINES = ET_TEXT_LINES

ET_PRTS = ET_PRTS

ET_COSTS_SUM = ET_COSTS_SUM

ET_COSTS_DETAILS = ET_COST_DET

RETURN = RETURN1.


*Display order status

cl_demo_output=>display_data( ET_OPERATIONS ).

am getting all tables fields with 0 values am able to get only export parameters values.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sandra Rossi Jan 25 at 09:19 PM
1

Why are you using the obsolete and "evil" HEADER LINES ! There's a good reason why they are obsolete - it's because they are prone to errors.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 25 at 04:36 PM
0

Hi,

set a breakpoint after the BAPI an have a look into several tables like

ET_OPERATIONS

.Are there any entries in the tables?


Regards, Dieter

Share
10 |10000 characters needed characters left characters exceeded