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 Add XREF1_HD(Reference Key 1 internal for document Header) field to header level to transaction FB01

Former Member

Hi All,

My requirement is i want to add field in XREF1_HD(Reference Key 1 internal for document Header) in header level to standard transaction FB01,my understanding by referring some of the posts in SCN  that  by using BADI : BADI FI_Header_Sub_1300 will help us to add the field to FB01 Transaction.

Can any one please explain the complete  procedure how to acheive the above requirement in brief,can any one please do the needful to me..

Thanks

Ramesh

17 REPLIES 17

Former Member
0 Kudos

Hi Ramesh,

one standard BADI implementation FI_HEADER_SUB_1300IM is available for the BADI definition FI_Header_Sub_1300.

Please go through that one  and do the same  your custom implementation part, add  same subscreen area like SAPLBADI_EXAMPLE_1300 screen number 1300.

and goto interface part (PUT_DATA_TO_SCREEN_PAI, GET_DATA_FROM_SCREEN_PAI) and do the code for field XREF1_HD.

activate your custom BADI and check.

Regards,

Prasenjit

0 Kudos

Hi Mishra,

Thanks for your reply i am first time working with this requirement ,can you please write sample code for the interface i mean in the events and where we can enhance these BADI in standard report FB01.

Please Mishra help me out ....

Thanks,

Ramesh

0 Kudos

As Prasenjit Mishra wrote, call transaction SE19 and look at implementation FI_HEADER_SUB_1300IM, this one activate fields BKPF-XREF1_HD and BKPF-XREF2_HD. So just create implementation and copy class and dynpro+program, to your namespace and adjust...

(If in a hurry, you could even activate the sample )

Regards,

Raymond

0 Kudos

Hi Raymond,

I have copied standard implentation FI_HEADER_SUB_1300IM to Custom implementation   ZIMP_Header_sub_1300 in this implementation in which module i have to code to add XREF1_HD field and i which module pool screen i have to populate the field.

when i run the FB01 transaction these field should reflect be reflected in that screen,but you said that copy dynpro and program once we copied it it will be as custom program ,when we run transaction FB01 the field may not be reflected in that standard screen of FB01.

can you please explain the approach how to work out it.

Thanks,

Ramesh

0 Kudos

Copy the dynpro SAPLBADI_EXAMPLE_1300(1300) to one z-FG in your namespace, then attach it in your z-Implementation. This customer subscreen will be displayed in dynpro SAPMF05A(1300) area APPL_SUB. Look in the PBO/PAI logic of the dynpro to understand how it will communicate with the class implementation.

Regards,

Raymond

0 Kudos

Hi Raymond,

i have copied SAPLBADI_EXAMPLE_1300 to one custom ZFG and placed into my Zimplementation ,and i want XREF1_HD field only so i deleted XREF2_HD from the subscreen and activated the implementation.

But when i called FB01 the field is not implemented in the screen,can you please guide me what else i would do, i mean i have to code any thing in the code i.e in PBO or PAI in the zimplementation part.

Thanks,

Ramesh.

0 Kudos

Hi Raymond,

i have copied SAPLBADI_EXAMPLE_1300 to one custom ZFG and placed into my Zimplementation ,and i want XREF1_HD field only so i deleted XREF2_HD from the subscreen and activated the implementation.

But when i called FB01 the field is not implemented in the screen,can you please guide me what else i would do, i mean i have to code any thing in the code i.e in PBO or PAI in the zimplementation part.

Thanks,

Ramesh

0 Kudos

Hi Mishra,

Now i can succesfully added Field XREF1_HD field in FB01 screen,when i entered  data in this field from FB01 screen the data should be populated to BKPF Table.

Can you please suggest me where to write code i mean in which event for this and sample code how to do.

Thanks,

Ramesh

0 Kudos

Hi Ramesh,

Please write your code  in the method  PUT_DATA_TO_SCREEN_PAI .

IM_BKPF-XREF1_HD = if_ex_fi_header_sub_1300~bkpf-XREF1_HD .

 

and use your code in mrthod PUT_DATA_TO_SCREEN_PBO

  me->if_ex_fi_header_sub_1300~bkpf-xref1-HD = im_bkpf-xref1_hd.
  me
->if_ex_fi_header_sub_1300~x_no_input = im_x_no_input.

and  use your code in the method GET_DATA_FROM_SCREEN_PAI

ex_bkpf-XREF1_HD = me->if_ex_fi_header_sub_1300~bkpf-XREF1_HD.

and  use your code in the method GET_DATA_FROM_SCREEN_PBO

ex_bkpf-XREF1_HD = me->if_ex_fi_header_sub_1300~bkpf-XREF1_HD.
  ex_x_no_input 
= me->if_ex_fi_header_sub_1300~x_no_input.

When I was done   that time  I was use this code, Please try to add  code in every method  for bnoth fields just like above.

Also, Please check in debug, If value is not updated in  BKPF table.

Regards,

Prasenjit

0 Kudos


Hi Mishra,

I can see field XREF1_HD field in Fb01 transaction,i want to  maintain value in this field(XREF1_HD) from FB01 screen,after entering value in this field and when i post this document the values should be populated into BKPF table and also should be seen in FB03 screen also.

Can you please help me how to solve this issue.

Thanks,

Ramesh

0 Kudos

Hi,

if your value is not updated in table BKPF then please use BTE 1120 for updating record in BKPF table.

you can append your XREF1_HD field in  BKPF-SUBST and pass your structure value  in this structure then value will be updated in BKPF table.

Please try to use this.

Regards,

Prasenjit

0 Kudos

Hi Mishra,

we are alreeady having XREF1_HD field in BKPF table ,just when we enter some data in Fb01 screen that should be saved in BKPF table ,i dont know how to work with BTE,i am thinking that as you said earlier can we add code in our custom implementation which we have implemented from badi definition  FI_HEADER_SUB_1300 for XREF1 field so that it might be populated in BKPF table.

can you guide me in this way it will work or not.

Thanks,

Ramesh

0 Kudos

Hi Mishra,

i have coded as you said earlier in custom implementation in thr following PAI and PBO modules,

but i am getting eror in one of the module in PAI as below:

((Class ZCL_IM_IMP_SUB_SCREEN_1300,Method IF_EX_FI_HEADER_SUB_1300~PUT_DATA_TO_SCREEN_PAI

The field "IM_BKPF-XREF1_HD" cannot be changed.))

the below code i have copied in that PAI as below:

Please write your code  in the method  PUT_DATA_TO_SCREEN_PAI .

IM_BKPF-XREF1_HD = if_ex_fi_header_sub_1300~bkpf-XREF1_HD .

Can you please tell me what shouldbe done,if we code in this way we can populate field data in BKPF table?

Thanks,

Ramesh

0 Kudos

Hi Ramesh,

Could you please tell me, you create new screen or you added screen number 1300?

Please simulate your code same as like  implementation example in screen as well as method then the value will be updated in BKPF.

In my above thread , I have used all value based on my requirement. Please update all details in thread  then I can try to helping you and you can also try to  debug your screen  field value as well as method  for understanding this BADI process.

Thanks,

Prasenjit

0 Kudos

Hi Mishra,

I Added screen 1300 i.e subscreen and added field in the Fb01 screen ,now i want to add data in this field after posting the document the value what ever i entered in this field should be placed in BKPF table in that field.

In which method i should write code ,i have code it in Zimplementation right? to populate data in the table from this screen field.

Thanks.

Ramesh

0 Kudos

This method is intended to receive BKPF (e.g. fields changed on standard screen) for PAI execution, use IF_EX_FI_HEADER_SUB_1300~GET_DATA_FROM_SCREEN_PAI to send data back from PAI, fill EX_BKPF.

Flow logic :

  1. IF_EX_FI_HEADER_SUB_1300~PUT_DATA_TO_SCREEN_PAI
  2. Execution of FIELD statements on PAI of customer screen
  3. IF_EX_FI_HEADER_SUB_1300~GET_DATA_FROM_SCREEN_PAI

Really, look at standard implementation FI_HEADER_SUB_1300IM. (e.g. PAI module in include LBADI_EXAMPLE_1300F01)

Regards,

Raymond

0 Kudos

Dear Revanth,

I got the same issue as you.

When I write the code IM_BKPF-XREF1_HD = if_ex_fi_header_sub_1300~bkpf-XREF1_HD in the method  PUT_DATA_TO_SCREEN_PAI , an error message displayed (The field "IM_BKPF-XREF1_HD" cannot be changed), so that I can compile the coding.

May I ask how do you solve the issue?

Also, do you know how to get the field value of the fields XREF1_HD and XREF2_HD from the screen?

Many thanks for your help

Sunny