‎2013 Jun 10 10:41 AM
Hi,
My requirement is to add 2 custom fields to the vendor master screens without using the append structure approach. Would this be possible by using a custom table and using the BADIs VENDOR_ADD_DATA and VENDOR_ADD_DATA_CS?
Please could you help me out with the step by step detail of using a custom table with these 2 BADIs without appending any fields to LFA1.
Thanks & Regards,
Neera Sood
‎2013 Jun 11 9:49 AM
Hi Raymond,
Thank you for your response. Could you be a bit more explicit on which parameters I can use. Please could you give me an example.
Thanks ,
Neera
‎2013 Jun 10 11:29 AM
Hi Neera,
If you do not want to have an append structure you need to put all the primary keys of your requirement ( i assume its only Customer Number i.e. KUNNR) in the Z table and put the Z fields.
Now The BADI's mentioned by you will add additional tab and it is similar to Customer BADI. Steps for the same are well documented at http://saptechnical.com/Tutorials/ABAP/XD01/XD01.htm
BR,
Ankit.
‎2013 Jun 10 11:29 AM
Hi Neera Sood
Check SAP Note 580266 - Enhancements without modification in vendor master
http://pavelgk.pbworks.com/f/sapnote_0000580266.pdf
See this also further reference
Regards,
Bastin.G
‎2013 Jun 10 11:52 AM
yes possible ,
first there a little config you need to do on Free enhancement of Vendor Master Record. you need to create a screen group and label it.
Then vendor_add_data badi you need to implement method CHECK_ADD_ON_ACTIVE
for your screen group set e_active = 'X' (this is the only thing you need to do in this BADI)
Then VENDOR_ADD_DATA_CS , fileter dependent on the screen group that you created in the config. you need to implement get_taxi_screen , passing the Zscreen you made in a seperate function group.
Now in GET_DATA and SET_ DATA you can call two custom FM that you would specifically make for your custom screen passing data to screen(storing it in the PAI of your custom screen) and setting data (reading data and passing it to screen in PBO of your custom screen).
I think the link provided above by all are very helpful....
one thing though , you actually need to save data at PAI to your custom table as you are not appending it to lfa1 , or you can use memory id to transfer it to memory , and in the method save_data of your vendor_add_data save it once to the database.
‎2013 Jun 10 12:29 PM
‎2013 Jun 10 12:53 PM
Hi everyone,
Thank you for your help. I will try this out in my system and get back to you.
Regards,
Neera Sood
‎2013 Jun 10 1:14 PM
Following screen appears:
Go to CHANGE mode and Click ‘New Entries’ button. Then add a Screen Group (SK here)and meaningful description. Save the entry and then SELECT that entry and Click on ‘Label Tab Pages’.
Add a Label Tab Page i.e. enter a Screen Number, Function Code and Meaningful Description.
Save the entry and come back to the SPRO screen. Click Business Add-in: Processing Master Data Enhancements
Create one Implementation by giving implementation name (must start with Z. ZSURESHKUMAR here). Give meaningful description and press enter. The following screen appears.
Go to Interface and Click on ‘CHECK_ADD_ON_ACTIVE’ method. Add the following code and save.
method IF_EX_CUSTOMER_ADD_DATA~CHECK_ADD_ON_ACTIVE .
data: l_flg_active type BOOLE-BOOLE.
if i_screen_group = 'SK'.
e_add_on_active = 'X'.
endif.
Activate that and come back to SPRO initial screen. Click Business Add-in: Customer Subscreens
The following screen will appear. Create one implementation (ZSURESHKUMAR1 here).
Press enter. The following screen will come. Enter a meaningful Description and Screen Group (which we created earlier) as shown below.
Then go to Interface
Create a Function Pool SAPLZSURESHKUMAR. (See the code of the program for other details). Create a Screen ‘1111’ with field old Customer Number – screen group PSK (SE51)
Click on GET_TAXI_SCREEN method and add the following code.
method IF_EX_CUSTOMER_ADD_DATA_CS~GET_TAXI_SCREEN .
case i_taxi_fcode.
when 'SK_TAB'.
e_screen = '1111'. "Eart + Objekt
e_program = 'SAPLZSURESHKUMAR'.
e_headerscreen_layout = ' '.
endcase.
Activate and leave the transaction.
Go to KNA1 (Customer Master) table and add a custom field as shown below. Activate the table
Now go to XD01 transaction.
The screen we created will appear as shown in the above screen-shot. Click the button. The following screen will appear.
Enter a customer number and save the transaction. Now go to KNA1 table and check the value of the Old Customer Number field’s value. The value you entered in this screen will appear on there.
Until now, we have written code for creating the Custom field. Now we need to disable that field when we are opening the transaction in DISPLAY mode.
Go to include – LZSURESHKUMARTOP and enter the following code and activate the program.
Now execute the Transaction in display mode and check the output.
Regards
Naresh
‎2013 Jun 10 7:01 PM
Hi,
Yes it is possible.Create z table with key as header table key if you want add fields in header data or item table key if you want to add item level .Then add tab,screen ,fields as normal but you have to write your own update function module and call it in IF_EX_VENDOR_ADD_DATA~ SAVE_DATA. In display mode you need to select data from custom table and make available in IF_EX_VENDOR_ADD_DATA~READ_ADD_ON_DATA
Regards,
Sreenivas.
‎2013 Jun 11 7:45 AM
Hi ,
I have updated/modified the custom table in the method IF_EX_VENDOR_ADD_DATA~SAVE_DATA and I have set the data in method IF_EX_VENDOR_ADD_DATA_CS~SET_DATA.
Could you let me know how I will get the data when switching between screens? The GET_DATA method of IF_EX_VENDOR_ADD_DATA_CS and the READ_ADD_ON_DATA of IF_EX_VENDOR_ADD_DATA do not have an interface(signature) to support the new fields from the custom table.
Thanks,
Neera
‎2013 Jun 11 9:17 AM
‎2013 Jun 11 9:49 AM
Hi Raymond,
Thank you for your response. Could you be a bit more explicit on which parameters I can use. Please could you give me an example.
Thanks ,
Neera
‎2013 Jun 11 10:52 AM
One soultion could be
Many variations availabe, like storing data in a function group (same that would contain the subscreen)
(And yes, much simplier to append z-fields, and so get the data from standard)
Regards,
Raymond
‎2013 Jun 13 11:25 AM
hi,
Please could you let me know how I can access the vendor number in the new subscreen which has been created for the additional custom fields.
The vendor number is required for selection from the custom table in the PBO of the subscreen.
Alternatively, please could you let me know how I can fetch the details of the custom fields from the custom table for vendors which already have data in the custom fields i.e. in change mode
Thanks,
Neera
‎2013 Jun 13 12:03 PM
Hi Neera,
Try reading the screen Field Value as,
field-symbols <fs_lifnr> type any.
constants lc_lifnr type char30 value '(SAPMF02K)LFA1-LIFNR'.
Assign (lc_lifnr) to <fs_lifnr>.
<fs_lifnr> is the field symbol with your value.
BR,
Ankit.