‎2007 Aug 27 3:46 PM
When I call this BAPI throw se37 + test - all is OK , I enter order number , smth like 900003 and obtain result tables.
But When I write the same in ABAP:
**********************************************************
DATA:
BRET LIKE TABLE OF BAPIRET2,
BRETREC LIKE BAPIRET2.
START-OF-SELECTION.
ORDNUM = '900003'.
CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
EXPORTING
NUMBER = ORDNUM
TABLES
RETURN = BRET.
LOOP AT BRET INTO BRETREC.
WRITE: / BRETREC-TYPE , BRETREC-MESSAGE.
ENDLOOP.
*******************************************************************
I obtain error : BRETREC-TYPE = 'E' ,
BRETREC-MESSAGE = 'Error reading the order in document tables'
We have only 2 non-optional params , but I try to propose all - the result was th same.
What's the problem ?
‎2007 Aug 27 3:52 PM
u have to send data in Full Length Format.
If order field length is 10 , then u have to pass Order = '0000900003'.
Regards
Peram
‎2007 Aug 27 3:55 PM
I think the order number is not exissting or the format is wrong..
try the conversion functionmodule
DATA:
BRET LIKE TABLE OF BAPIRET2,
BRETREC LIKE BAPIRET2.
START-OF-SELECTION.
ORDNUM = '900003'.
<b>call function 'conversion_exit_alpha_input'
exporting
input = ordnum
importing
output = ordnum.</b>
CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
EXPORTING
NUMBER = ORDNUM
TABLES
RETURN = BRET.
LOOP AT BRET INTO BRETREC.
WRITE: / BRETREC-TYPE , BRETREC-MESSAGE.
ENDLOOP.
‎2007 Aug 27 4:10 PM