Skip to Content
author's profile photo Former Member
Former Member

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

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!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2013 at 07:52 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 05, 2013 at 05:50 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 05, 2013 at 07:26 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      § 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>.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.