10-01-2008 1:30 PM
Hello,
i´ve written a FM which also calls SAP FM´s.
Somewhere there is this statement:
else.
message w207(m7) with ymcha-charg ymcha-matnr.
endif.
This line throws an error... Because the FM is used in a job, this job aborts.
What can i do? I dont want to change the sap code?
10-01-2008 1:46 PM
Hi
All the standard SAP FM's have a return structure where the errors get stored. All u have to do is to pass internal table to it and then catch the error and where it is happening.
Regards,
Vishwa.
10-01-2008 1:49 PM
Hello,
the FM i call is BAPI_BATCH_CHANGE.
This FM returns no table, it shows a naked screen with the error message
10-01-2008 1:52 PM
Hi
Check this:
data: it_ret type standard table of bapiret2,
wa_ret type bapiret2
CALL FUNCTION 'BAPI_BATCH_CHANGE'
EXPORTING
MATERIAL =
BATCH =
* PLANT =
BATCHATTRIBUTES =
BATCHATTRIBUTESX =
* BATCHCONTROLFIELDS =
* INTERNALNUMBERCOM =
* EXTENSION1 =
* MATERIAL_EVG =
IMPORTING
* BATCHATTRIBUTES =
TABLES
RETURN = it_ret " this is the table I am talking about.
Once u execute the bapi, the errors get stored in here..which can be passed onto a loop and using write can be displayed.
Loop at it_ret into wa_ret.
write: / wa_ret-message.
endloop.
10-01-2008 1:54 PM
Are you passing the parameter RETURN of type BAPIRET2 to this bapi when you call the function ?
regards,
Advait
10-01-2008 1:54 PM
Hello,
i do it like you described...
If the FM runs on the code line above, it immediate stopps the logic and shows a blank screen with the error message. i debuged it...
10-01-2008 1:54 PM
Hello,
This BAPI has the return table RETURN that return all messages regarding the execution.
Regards.
10-01-2008 1:57 PM
If the FM runs on the code line above, it immediate stopps the logic and shows a blank screen with the error message. i debuged it...
I failed to understand the reply. Does it mean your issue is resolved or
Can u please tell me where does the issue stand?
Regards,
Vishwa.
10-01-2008 2:01 PM
No it is not resolved. The hints doesnt work. Error ist still the same.
The Calling of the FM:
CALL FUNCTION 'BAPI_BATCH_CHANGE'
EXPORTING
material = ls_bapibatchkey-material
batch = ls_bapibatchkey-batch
plant = ls_bapibatchkey-plant
batchattributes = ls_bapibatchatt
batchattributesx = ls_bapibatchattx
batchcontrolfields = ls_bapibatchcontrolfields
INTERNALNUMBERCOM =
EXTENSION1 =
IMPORTING
batchattributes = ls_bapibatchatt
TABLES
return = lt_return.
And then the steps of the program:
BAPI_BATCH_CHANGE
VB_CHANGE_BATCH
CHARGE_KLASSIFIZIEREN => here it breaks in line 69
10-01-2008 3:13 PM
Hi,
Sorry you cannot do anything about it. It is standard code and if the job is getting cancelled, it is normal behavior of the program and it seems some config related to Batches and Classes is missing in your system. Because the message says :
For batch & of material & &, no class could be determined
So if you correct that problem, you will not get that error anymore.
regards,
Advait.
10-01-2008 3:21 PM
It appears to be missing configuration. Have you checked the long text for the message?
Rob