cancel
Showing results for 
Search instead for 
Did you mean: 

Requirement Routine for Output Control for Sales Contract

Former Member
0 Kudos

Dear friends,

I have a requirement, where the output for the Sales Contract should not be processed if it is having Delivery Block for example '99'. I have assigned standard routine '2' to the output type. But still the document is getting processed and output being generated. I have done all the necessary configuration.

Can any one is having idea what I am missing?

I appreciate your answer.

Thank you,

Prakash

Accepted Solutions (1)

Accepted Solutions (1)

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

First of all, enhance the structure KOMKBV1 with an append with a copy of field VBAK-LIFSK (eg: ZZLIFSK). You can do it with the userexit USEREXIT_KOMKBV1_FILL in the report RVCOMFZZ.

Second, define an own VOFM subroutine, if KOMKBV1-ZZLIFSK <> '99' then sy-subrc = 0.

I hope this helps you

Regards,

Eduardo

Former Member
0 Kudos

Hi

Thank you for the reply.

As you said, we had created structure KOMKBV1 and in that we already defined the field VBAK-LIFSK. Also we have defined new VOFM routine copy of '2' and incorporated the delivery block 'not equal to blank'. Still, the system is not able to stop the processing of the message. Even though the block is set, it is creating the output message. I went through debugging mode, and is finding the right routine, which is assigned, and is getting the value '99'. But not stopping the further processing of the output message.

Let me know if any thing I missed out.

Thank you,

Prakash

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

After the creation of the copy of VOFM, have you run the report RV80HGEN?

Check this link about VOFM and check steps: http://saptechsolutions.com/pdf/InsideVOFM.pdf

If you have done it, please, reply me with the coding of the new VOFM.

Regards,

Eduardo

Former Member
0 Kudos

Hi

Thanks again for the reply.

I am not really a technical guy (I know little bit of technical aspects) and I am afraid of running this report. I am working in development client, and can I check whether it is activated or not?

The coding is very much similar to the routine '2' and some piece of coding added like below:

SY-SUBRC = 0.

IF KOMKBV1-UVALL NE 'C'.

SY-SUBRC = 4.

EXIT.

ENDIF.

IF KOMKBV1-COSTA NE SPACE AND

KOMKBV1-COSTA NE 'C'.

SY-SUBRC = 4.

EXIT.

  • Check delivery block only for ZZZ and ZCZZ

IF KOMKBV1-AUART EQ 'ZZZ' OR KOMKBV1-AUART EQ 'ZCZZ'.

IF NOT KOMKBV1-LIFSK IS INITIAL.

and rest of the part is same as routine '2'. It is checking for particualar sales document types.

Hope this will help in analysing.

Thank you,

Prakash

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

Go to SE38 and view the report SAPLV61B. Go to the include LV61BNNN, the VOFM 002 is LV61B002, the own or 'user routinen' are in RV61BNNN, if the VOFM is activated, then it must appear as RV61BXXX where xxx is the number of VOFM routine (the role of report RV80HGEN is create this include).

By your coding, if UVALL ne 'C' then the message isnt created and the report doesn't do more verifications (sentence EXIT). I think that AUART zzz and zczz are the contracts.

I hope this helps you

Regards,

Eduardo

Former Member
0 Kudos

Hi

Yes, the routine is activated. I have checked in the way you have described.

So, what I need to be done if I dont want to process the output message, if the delivery block is not blank? My ABAPer copied the existing routine and just added a piece of code as I explained you.

Can you give me any idea?

Thank you,

Prakash

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

Check in tcode V/43 the settings for the contracts (ie: ZZZ and ZCZZ) and the output.

Second, in IMG for SD, in output control go to output determination procedure and for the procedure set in V/043 (eg: V08000) in control data, set the entry (output and VOFM routine).

Finally, if you want that the output will be automatic, do the settings in VV11/VV12 and so on.

Regards,

Eduardo

Former Member
0 Kudos

Hi

From the customisation point everything is working fine, as it is calling the right routine. But only thing it is not able to restrict the processing of output message as delivery block is '99'.

Thank you,

Prakash

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

Then the coding for VOFM must be:

IF komkbv1-lifsk = '99'.

sy-subrc = 0.

EXIT.

ENDIF.

If you want to understand how to work this routines, if sy-subrc = 4 the output message is not created, if sy-subrc = 0 then the system creates de output message. Note 156230 'Requirements: What is permitted, what is not?' helps you to understand how to works this routines.

Regards,

Eduardo

Answers (0)