Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed in Message Control - very urgent

Former Member
0 Kudos

Hi Experts,

I have one requirement where in the customer wants to stop creation of IDOC which posts Invoice using message control and message control status should be changed to RED color and also the message should be populated in the processing log saying 'IDOC processing failed, External customer numbers not maintained'.

Could you please let me know any user exits or customer exits available for this purpose.

I have searched all the possibilities.

I have chanked the program RSNAST00 which picks up the data from table NAST and looks into table TNAPR to get the processing porgram for th selected output and also this program checks the partner profile and gets the process code which creates an inoice IDOC. I searched for user exits and customer exits to popolate the required messages and stop IDOC creation.

I am an ABAPER and i know i need to write code to do validation, but could not find the exact place where to write? I any ABAPERS looking at this post, please reply me.

Can anyone please advise me how to go about solving this issue?

Thanks

Srinath

7 REPLIES 7

Former Member
0 Kudos

For changing the status of message u can use FM

MESSAGE s001(zs).

CALL FUNCTION 'NAST_PROTOCOL_UPDATE'

EXPORTING

msg_arbgb = syst-msgid" S-Status

msg_nr = syst-msgno

msg_ty = 'E'

msg_v1 = syst-msgv1

msg_v2 = syst-msgv2

EXCEPTIONS

OTHERS = 0.

For checking the IDoc u have to write one requirement routine in Tcode VOFM.

Then goto Tcode NACE-V3-Procedures

there select your Message type and add this routine number.

Thanks,

Utsah garg.

0 Kudos

can u tell me what is the IDOc type u r using and the FM for sending the IDoc.

You have to look for a point to update the status table of Idoc with an Entry with Status number 51.

This should be done before a call to FM MASTER_IDOC_DISTRIBUTE is made.

Thanks.

0 Kudos

Hi Utsah garg,

Thanks very much for your quick reply.

This has to be done when we populate the output while creating a billing document in tcode VF03. After saving, i need to do some validations and if it satisfy the condition, then i need to stop idoc creation and make the output to RED which is not processed status.

For Invoice creation the message tpe used will be INVOIC and the process code SD09 and function module is IDOC_OUTPUT_INVOIC

Output type is ZXX1 - Invoice Idoc for EDI

Output medium is EDI

I want to know where can i add my code for validations and populate new error message and put it in application log.

Please let me know if you need more details.

Thanks

Srinath

0 Kudos

Hi,

Which release you are working on? If it is more than 46c you may find Enhancement points in this function module. Create your own enhancement & add reqd logic.

Otherwise based on what condition you want to issue error? In this function module there are some user exits such as EXIT_SAPLVEDF_001, EXIT_SAPLVEDF_002 can be used .

Best Regards

Mahendra

0 Kudos

Hi Mahendra,

Thanks for your inputs.

I am working in ECC 6.0, so i can user enhancement framework. But I have read the documentation, but don;t have practical exposure to this. I think first we need to find out the enhancement spots and create an enhancement using SE19 and add required code there. While creating enhancement in SE19, i think we need to provide the name of the enhancement spot detected instead of the BADI Definition.

Also I have a question reagrding the customer exits mentioned by you. I think these exits will be called when the function module IDOC_OUTPUT_ORDERS is called. But my requirement is to stop IDOC creation itself and populate the message in message control application log and make the output icon as RED

Thanks

Srinath

0 Kudos

Hi,

I am sending the requirement.

Please send me the solution.

Requirements:

1. EDI Invoice requires populating bottle UPC number not case UPC in IDOC and also populates customer PO number when invoice billing type is a credit. These changes need to be reflected on EDI invoice (Idoc INVOIC02).

Investigation:

Requirement 1. EDI invoices are populating segment E1EDP19 qualifier 003 based on the unit of measure in the line item. If shipment unit is CSE then it populates CSE upc, if shipment unit is EA then it populates Bottle UPC.

a. It was found that the UPC populated on the EDI invoice was being read from material master – Additional data tab. (Field SMEINH-EAN11). For the EDI invoice, the customers expect the bottle UPC on this column.

Requirement 2. Need to always populate Segment E1EDK02 Qualifier 001 (customer PO) on the INVOIC02 idoc. Standard SAP populates this information only when the billing type is F2 (regular invoice) and if the customer PO was entered in the Sales Order.

a) Premier requires this information to be populated in the idoc if the billing type is G2, RE, L2 also.

Solution:

Requirement 1.

IDOC_OUTPUT_INVOIC function module needs to be changed to always populate the UPC number for the bottle UPC in segment E1EDP19 qualifier 003, field IDTNR. This number is found on the material master – Basic data 1 view. Field name is MARA-EAN11. Please see screenshot of where in the material master to find the bottle UPC.

a. This change applies to all billing types (F2, G2, L2, RE etc).

Requirement 2.

Change IDOC_OUTPUT_INVOIC function module to always populate customer PO information in Segment E1EDK02 qualifier 001, field BELNR.

If billing type is equal to G2, L2, RE and VBRK-XBLNR not equal blanks then make BELNR = VBRK-XBLNR.

Segment: E1EDK02

Field: QUAL = 001

Field: BELNR = VBRK-XBLNR

Please help me how to move a step ahead.

Waiting for your immediate response.

Thanks,

Chandra.

Former Member
0 Kudos

Hi ,

My requirement is some what similar to Srinath and its urgent. But i would like to create the IDOC with Error status. I need to validate something at the control record level and if it fails i need to Error out the IDOC say status 51 or any status in RED with my custom status message.

Srinath - I tried raising the exception in my user exit and it did'nt create the IDOC but it did not made the output red...So, I dont know if that will help you??

Any ideas on how to do this is really appreciated!!

Thanks,

Naveed.