‎2013 Sep 24 6:38 PM
Hi Experts,
I have included a selection screen block like that of a copied standard program (ZRM07MLBD) in my custom program as given below.
I want to enter values in this custom program and want to skip the copied standard selection screen. I am using submit statement for this.
SUBMIT ZRM07MLBD WITH MATNR IN MATNR WITH BUKRS IN BUKRS WITH WERKS IN WERKS WITH LGORT IN LGORT WITH CHARG IN CHARG
WITH BWTAR IN BWTAR WITH BWART IN BWART WITH SOBKZ EQ SOBKZ WITH DATUM IN DATUM AND RETURN.
But the problem happens when I enter inexisting company code or plant. Then it is showing the error in the status bar in the copied standard program. See the below screen shot.
I wanted to show the error message in the same custom program. But it is navigating to the copied standard program and showing the error from the program (ZRM07MLBD). How can I show the error message in the same custom program?
BR.
‎2013 Sep 24 8:49 PM
Hello BR,
the std program is using the Message Class M7. The particular error message# is 348 and coming up from the code below.
Copying a Std prog is not actually copying into Z, it would also require copying of the Message classes, Includes etc, as and when required.
Please do copy the Message class also and use the same in the Z program.
Thanks,
Krishna Teja Peddada.
‎2013 Sep 25 1:00 AM
Hi Krishna,
With all due respect, your info is non sense. Message classes have nothing to do with the program, you don't need to copy a message class when copying a std program. You might need to copy includes, screens and pf-status IF you want to change these elements. Also, the problem described has absolute nothing to do with the message class.
Regards,
Custodio
‎2013 Sep 25 9:56 PM
Hi Custodio,
Thanks for clarifying me. I interpreted the issue in another way. I thought the error message was to be modified. But after seeing your response and reading the initial question again, I made myself clear.
I will take this as an alert to read the post twice before posting any reply
Thanks,
Krishna.
‎2013 Sep 26 1:17 AM
Hi Krishna,
I was a bit afraid you could take it as bullying. I'm glad you took it easy. I guess that's how we make each other better, isn't it?
Cheers,
Custodio
‎2013 Sep 25 1:04 AM
Hi ABAP ABAP (I reckon this is not your real name),
The message is displayed in the program being called because there is where the selection screen is being validates (see AT SELECTION SCREEN).
If you want to display the message in the calling program, you need to validate the entry in said proigram, ie, BEFORE submitting to your copied program.
Regards,
Custodio.
‎2013 Sep 25 3:32 AM
Hi Custodio,
Can you give me a hint on how to proceed on this. In my custom program I am not writing any code related to ZRM07MLBD except the submit statement. So how should I show the error messages on the same selection screen of custom program. All the validation statements in ZRM07MLBD have to be brought into the custom program?
‎2013 Sep 25 3:51 AM
Hi,
Well, this is (one of ) the problem of copying std programs... Although you'd have this problem even if you submitted the std program and not the copy.
Anyway, yes, if you need ALL validations from std program to be performed/displayed in your custom program, you will need to copy it.
Alternatively, you may check with your functional and/or the business what is really important to validate upfront and implement in your custom program.
Cheers,
Custodio
‎2013 Sep 25 5:30 AM
Hi,
You can check how each field is being validated in your standard program.
Mostly the validations are carrie dout based on check table.
the table for company codes is t001.
Likewise check the validations for the rest of the fields.
and before you pass the selection criteria using the submit statement perform these validations in your custom program and display the error messages.
Regards,
Vamsi