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: 

How to Set NAST-AKTIV while creating Invoice VF01/VF02/VF03

Former Member
0 Kudos

Hello Gurus,

Below is the requirement in our project.

Current procedure :

Each time after creating Invoice , Output Type ZXXX ( Medium 6 -EDI ) will trigger in yellow with VSZTP = 1(Send with periodically scheduled job).

Then we are processing this output Type with RSNAST00 and IDoc is generated once output Type is processed ( now output type is green mode).

Now , Requirement is like Output Type should processed if and only if Invoice is Approved i.e Posting Status is 'C'.

I found function exit for RSNAST00.

Enhancement : VN000001  Customer exits in output determination 

EXIT_SAPLV61B_001              WFMC: Find Fax Number

EXIT_SAPLV61B_002              WFMC: Set Print Parameters

But none of this is related to medium 6 EDI/IDOC.

I did some R&D and found out that if  NAST-AKTIV = 'X'  then output type will not be processed by RSNAST00.

So I am thinking to write below code in some user exit.

IF  Posting Status EQ 'C'.

     NAST-AKTIV = ' '.

ELSE.

     NAST-AKTIV = 'X'.

ENDIF.

Problem is I am not able to find userexit where I can modify NAST structure as it is non-modifiable in user exit.

Can someone help in where I need to write the code or is there any other way to achieve this requirement.

Thanks in advance.

Regards,

Mayur

1 ACCEPTED SOLUTION

Jelena
Active Contributor
0 Kudos

There is a standard VOFM routine 62 that prevents billing output from being generated if the document did not post to accounting. It needs to be assigned to the output type in the configuration (NACE).

If document was not posted then this requirement will not be met and no output will be generated. When the document gets posted, output determination will run again and output will be created.

It's very simple, there is no need for a user exit. If you have some additional requirements, just create a custom routine and incorporate the code from routine 62.

11 REPLIES 11

FredericGirod
Active Contributor
0 Kudos

Hi Mayur,

when you print invoice, invoice must be send to CO, if not you can't print invoice. That's is check in a routine linkt to the NACE transaction.

In NACE transaction you could put a routine in the link between schema & output type. This routine for invoice must check your status "C"

But, that will never lock user to manually send the invoice. To do this, you have to modify the program that call the IDoc / Smartforms / ...

regards

Fred

0 Kudos

Hello Fred,

Thanks for your input.

Sorry but I am not able to understand your solution properly.

After processing Output Type IDoc will trigger , so I don't have anything to do with printing.

In NACE transaction following Entry is mentioned against Output Type.

Medium      Program           Form Routine

6 EDI      RSNASTED       EDI_PROCESSING               

and as you said 'modify the program which call IDoc' , Do you mean to say I need to modify standard program RSNASTED or RSNAST00.

Thanks,

Mayur

0 Kudos

Hi,

I have found this doc : http://www.saptechnical.com/Tutorials/ALE/MessageControl/Index.htm

it explains how to go in the procedure from the NACE transaction. You must show for the printing support a value in requierement. If you press F4, you could see all the requierement available, and see the code.

To create a requierement you will need to use the transaction VOFM

To activate new requirement you will need to start program RV80HGEN

regards

Fred    

0 Kudos

Hi Fred,

Thanks a lot for your valuable input.

Regards,

Mayur.

Jelena
Active Contributor
0 Kudos

There is a standard VOFM routine 62 that prevents billing output from being generated if the document did not post to accounting. It needs to be assigned to the output type in the configuration (NACE).

If document was not posted then this requirement will not be met and no output will be generated. When the document gets posted, output determination will run again and output will be created.

It's very simple, there is no need for a user exit. If you have some additional requirements, just create a custom routine and incorporate the code from routine 62.

Former Member
0 Kudos

Hi Jelena,

Thanks for your input.

let me try out that one. will come back to you ...

Regards,

Mayur

Former Member
0 Kudos

Hi Jelena,

quick question ...

Could you please tell me where do I need to assign VOFM routine in the output type configuration NACE?

Thank you.

Regards,

Mayur

Jelena
Active Contributor
0 Kudos

Mayur, you might need to ask a functional person to configure the output. Normally a requirement routine is assigned in the output determination procedure (Procedures button).

Former Member
0 Kudos

Hi Jenela,

Yup u r  solution worked ..

I have created custom routine and did same what u said.

Now output type is triggering only if posting status is 'C'.

I have created invoice using VF01 , postins status is in A ( This time output is

not Triggered).

Then I ran Transaction VFX3 and then status changes to  'C' . (After this output

is Triggered).

This is worked for above scenario.

let me show this to user and will get back to you.

Thanks a lot for all u r valuable infomation.

One more doubt , will custome routine will each hit each time when posting

status of invoice changed to 'C' .

I mean to say there might be many ways like workflow , vfx3 etc etc to change

posting status of invoice to 'C' correct ( Please correct me if I am wrong).

so will it be work for each time?

Regards,

Mayur

Jelena
Active Contributor
0 Kudos

I can't guarantee 100% (which is why you'd need to test releasing an invoice through all the possible channels), but it works for sure if invoice is released in VF02 or VFX3.

Former Member
0 Kudos

Okies , Then I will check with user what are different ways he is using to release Invoice.

I am keeping this thread open till I get confirmation from user.

Thanks a lot Jenela for your valuable time and support.

Regards,

Mayur.