04-20-2018 11:02 PM
Currently my program is using a batch number that's combines with my Julian date to pull data. Its pulling data based on the newest year but how do I set it that it pulls it using the oldest year listed.
And another issue is how do I tell a program to ignore an error message.
So the program runs and its set to a specific plant and that plant doesn't have what it needs to create but it sends out an error and stops working. (that's what its doing now) but I want it to still send me the error if it can not be created at the plant but moves on to the next line to create that from a different plant.
04-21-2018 3:01 PM
Hi
Although this is not a real question - I'll try to answer this:
I assume we are talking about ABAP!?
If there is no other way just split all you batch names into different ITab fields and sort as according to your requirements.
How do you create your plant?
What does "sends out an erro" mean? Do you get an email, a message, a dump,...?
With CALL TRANSACTION you have the option of MESSAGES INTO itab.
With BAPIs you have RETURN Table/Structure.
Maybe you have to catch some exception? Standard exceptions or exception classes.
regards
Domi
04-21-2018 10:18 PM
sorry, yes I'm talking about Abap. I want to split my Julian dates up so I can sort it by a certain number. this is what ive gotten so far.
DATA: la_item-jul_day like charg,
la_item-jul_year like charg.
la_item-jul_day = l_charg_d(3) + 0.
la_item-jul_year = l_charg_d(1) + 3.
it gives me an error that says
Arithmetic operations are only intended for operands that can be converted to numbers (number-like operands). operands). - - - - - - - -
SORT it_item BY jul_year ASCENDING jul_day ASCENDING.
and for the rejected line it deplays a message. here is the code for it.
SELECT SINGLE plant
INTO l_plant_so
FROM vbap
WHERE vbeln = l_salesord
AND ( plant <> ' ' OR plant<> '0000' ).
IF sy-subrc = 0.
IF w_werks <> l_werks_so.
* p_w_err = abap_true.
PERFORM log_error_fops TABLES it_idoc_status USING w_docnum '56'
'E' 'ZM' '004' 'Sales order does not exist at plant'(233)
w_werks ' ' ' '.
04-21-2018 10:41 PM
Hi
CHARG is a structure, don't you need CHARG_D instead? Or is this just an copy error?
la_item-jul_day = l_charg_d(3) + 0.
is an arithmetic operation,
if you want to split the number you need to use:
la_item-jul_day = l_charg_d+0(2). "<field>+offsetpositon(length)
I think it's done if you change the message to a warning:
PERFORM log_error_fops TABLES it_idoc_status USING w_docnum '56'
'W' 'ZM' '004'
'Sales order does not exist at plant'(233)
w_werks ' ' ' '.
regards
Domi
04-22-2018 12:56 AM
No component exists with the name "JUL_YEAR". "JUL_YEAR".
I receive that error when I'm sorting it out. and I know that those fields are not on the table so I can I sort it from ascending.
SORT it_items BY jul_year ASCENDING jul_day ASCENDING.
04-22-2018 1:25 AM
Hi
Sorry - but is this your first report?
Just create a new local structure and itab with includes the structure of your it_items (CHARG?) and the needed date field(s)
Fill the new itab from it_items and split the charg field into the date fields.
You can now sort your new itab and work with this instead of it_items.