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: 

Custom field in XD01/XD02/XD03 is not updated in Z table

Former Member
0 Kudos

Dear ABAP Gurus,

could you please help me to solve my issue. I'm a little bit new in ABAP.

I have created Z table with additional fields which I want to fill in XD01 TCODE. There is also KUNNR filed in my table.

Then I have created view and generated Functional Pool type SAPLmyZtable.

I have added new button in XD** transaction via SPRO.

Then updated require  BADis and created Screen.

I can see my screen in XD01/XD02 now but when I specify values there - the values are not populated in my Z table.

I need to have new line in my Z table with Customer number and values which I have entered on my screen in XD01/XD02.

Could you please advice what I should do?

In debug I can see that it is not going to my program SAPLmyZtable. Maybe I wrongly populated data in Screen flow logic in PBO and PAI?

Thank you very much in advance!

6 REPLIES 6

Former Member
0 Kudos

Which BADI are you using to your new screen with custom fields?

The BADI CUSTOMER_ADD_DATA_BI have some methods at saving that you can use to save additional data.

former_member251322
Discoverer
0 Kudos

I believe you are trying to update a Z table and can try these step,

  • - Goto function group of your screen and Declare a global variable of the Z table structure in include top.
  • - Custom screen PAI – pass the screen value to the global variable Z table structure
  • - Code to update Z table – Goto implementation of the interface “IF_EX_CUSTOMER_ADD_DATA_CS” method “GET_DATA”. Follow the code below,

  CONSTANTS:lc_ZTABLE TYPE <ZTABLE> VALUE '(SAPLZSD_CUSTOMER_EXT)<ZTABLE variable name specified in the PAI( To capture the data from custom screen)>.
" Note: SAPLZSD_CUSTOMER_EXT -> specify your function group name
FIELD-SYMBOLS: <FS_ZTABLE> TYPE <ZTABLE>.

*-----Check T.code Is Not a Display Screen
CHECK sy-tcode NE 'XD03'.

  ASSIGN (lc_ZTABLE) TO <fs_ZTABLE>.

Insert/modify ZTABLE from <FS_ZTABLE>

Let me know if this works.

0 Kudos

Dear Raj,

thank you very much for your reply.

Could you please clarify what exactly should I populate in this point - how to connect to SAPL pool:

  • - Custom screen PAI – pass the screen value to the global variable Z table structure

Thank you!

0 Kudos

§  I hope this will help you.

1) PAI - Pass the screen value to a global variable declared at your custom screen function group. By doing this at the run time of the XD01, screen value from your custom screen can be accessed.

Example: I have a screen 9001 added to XD01 with field called knvv-zzvdc2 and on my PAI, I will have the following code.

   MODULE user_command_9001 INPUT.
*-----Pass Value To The Global Variable, To Read It Form BADI
  gv_zzvdc = knvv-zzvdc2.
ENDMODULE.                 " USER_COMMAND_9001  INPUT

Global definition

Include:  LZSD_CUSTOMER_EXTTOP

   DATA: gv_zzvdc TYPE knvv-zzvdc.

2) BADI method : GET_DATA - Once you set the value on the global variable following code should help you to retrieve the value and save it on your Z Table

   *-----Local Data Declaration pointed to the function group
  CONSTANTS: lc_zzvdc TYPE knvv-zzvdc VALUE '(SAPLZSD_CUSTOMER_EXT)gv_zzvdc'.

  FIELD-SYMBOLS: <fs_zzvdc> TYPE ANY.

*-----Get The Value From The Custom Screen
  ASSIGN (lc_zzvdc) TO <fs_zzvdc>.

s_knvv-zzvdc2 = <fs_zzvdc>.

Former Member
0 Kudos

Hi Maria,

If this is the case you are talking about:

"In debug I can see that it is not going to my program SAPLmyZtable. Maybe I wrongly populated data in Screen flow logic in PBO and PAI?"

Then can you please post the PAI Code where you are performing logics on your screen parameters.

That is your chain-endchain code of screen parameters, which are not updated in debug mode in PAI.

0 Kudos

Dear Harshit,

that is the case as I'm not sure how to populate data in PAI and PBO.