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: 

I have added feilds in Addtitional Data B screen o SO,Now How will I Update

Former Member
0 Kudos

Hi All,

I have added feilds in Addtitional Data B screen on SO,

on a Particular Sales Document Type(ZTAL) I have to Enable one feild called Leasing Duration. in all other cases it has to be disabled or invisible.

How do i do it?

Also please let me know ?

How will i update the table VBAK once these feilds are enterd in the SO Addtitional Data B screen by the user and clicks save....

Should i code my logic for that in PBO .... of SAPMV45A -8309

Or should i go for a User Exit or a BADI

Please Answer!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

For sales order use MV45AFZZ user exit... You need to write appropriate code in one of the subroutinue for displaying the field and in another one to save the data to VBAK.

8 REPLIES 8

Former Member
0 Kudos

For sales order use MV45AFZZ user exit... You need to write appropriate code in one of the subroutinue for displaying the field and in another one to save the data to VBAK.

Former Member
0 Kudos

Hi Sap Gurus,

Theres one requirement tats come about from my client....in sales order VA01....they want tat the user cant save it until its been granted by the higher authority :

So i've cum to this solution tat ,

ie. before saving sales document it should ask for password , after entering password it will save.

SO guys how to make it possible. Which exit to use....or any other solution or suggestion u have.

Plzzz help me out.

Cheers and Regards,

Savy.

Former Member
0 Kudos

Hi Mohammed,

How will i update the table VBAK once these feilds are enterd in the SO Addtitional Data B screen by the user and clicks save....

If you are planning to bring in fields that needs to be updated in table VBAK(header sales) or Vbap (item sales) then

(1) first add the required fields as an append include in se11

go to se11 -> table -> click on "Append Structure" ..in the new pop up..create a new include by clicking on "create" or using an existing include if any..give the description and you will get a structure where you can enter the fields required

follow this for vbak/vbap

(2) Go to SAPMV45A program in Se38 and take screen

8310 for screen to add fields at (additional dataB -> header)

take the screen layout and select the fields

VBAP-ZZ fields or the newly added fields or the ones you need on additional data B -> item details,put in on this screen, save and activate

if you are showing fields from tables VBAK/VBAP in the screen of additional data B , no separate code needs to be written while saving and whatever checks that needs to be done for the fields,it can be done in 2 places

(a) in PAI/PBO of the screen itself

(b) go to se38 -> MV45AFZZ -> userexit_save_document or

userexit_save_document_prepare and write the code to check the conditions and give messages accordingly

here VBAK/VBAP data are available in XVBAK/XVBAP

If you are using Ztable fields on additional data B screen then we need to write code in PBO of the corresponding screen to fetch data in case of VA02/Va03 since data comes from a Ztable and not standard table VBAK/VBAP and also do validations here itself

on a Particular Sales Document Type(ZTAL) I have to Enable one feild called Leasing Duration. in all other cases it has to be disabled or invisible.

Should i code my logic for that in PBO .... of SAPMV45A -8309

Code can be written in PBO/PAI like a normal screen..

with screen number 8310 or 8309 of program SAPMV45A (VBAK-ZZ fields) to obtain fields on additional dataB of header

so check the "Sales Document Type" = ZTAL and do loop at screen and hide the fields as required

Please note that the program SAPMV45A is common for other transactions like sales contract VA41/42/43..so whenever we write code ..please put check for VA01/Va02/Va03

if sy-tcode = Va01..etc

endif...Also pls note that access key is required for screen modifications

Adding append structures to standard table VBAK/VBAP with required fields and using those fields on screen is advisable to avoid complications

Pls check & revert

Regards

Byju

0 Kudos

Thanks very much,

0 Kudos

Hi Byju,

The Flow logic of screen 8309, is not editable

there should be some thing like this ...

  • module screen_8309 .

So that i can uncomment it and then double click the same .....

and that would create

MODULE STATUS_8309 OUTPUT.*

...........

ENDMODULE.

In the Progr... SAPMV45A... in INCLUDE MV45AOZZ .... so that i can write my logic...

This line is not there.......

0 Kudos

Hi Mohammed,

First we go to screen 8309 or 8310

initially 8309 will contain only

process before output.

* Verarbeitung vor der Ausgabe

process after input.

* Verarbeitung nach der Eingabe

then when we click on "change" button..it will ask for access key...Once we enter the access key we need to create the required modules...when we create the "module" on the flow logic..we will be prompted for a transport request ....

When we create PBO/PAI of screen 8309 it should not be saved in MV45AFZZ....Yes,as you have mentioned there is no default 'MODULE STATUS_8309 OUTPUT/INPUT'..we have to create our own

include MV45AFZZ is different since it acts as a user exit for SAPMV45A program,we can create a custom include in SAPMV45A for the PBO/PAI logic of the screen 8309

in MV45AFZZ we have user exits of the form

userexit_save_document..etc where we can code to do various actions..please go to se38 -> mv45afzz -> display to avoid confusion

Pls check and let me know if you get stuck

Regards

Byju

0 Kudos

Hi,

    I added some field in 8309 screen but i want to display those fields only for a particular inquiry. Please tell me the procedure to do this.

Regards

ziya

0 Kudos

Hi Ziya,

It is better you can open another thread.It is very simple after adding the screen in the pbo double click

and place your code.This will goes to screen sapmv45a.You write your code and keep .Check this and tell me if need any help.

if.

Your code.

screen input = 0.

endif.