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: 

Update and transfer data via BADI LE_SHP_TAB_CUST_HEAD

Former Member
0 Kudos

Greetings All,

I've a requirement to create a custom tab in the VL01N/VL02N/VL03N header record displaying custom fields.

I've successfully implemented BADI LE_SHP_TAB_CUST_HEAD, created a subscreen, appended my custom fields to the LIKP table via append structure, and can now view my fields in the transactions listed above.

I'm having trouble updating the fields in the subscreen and save the values back to the LIKP table. First question is a) do I do this via the PBO PAI modules in my subscreen, or should I be doing this in the BADI?

Second question is, if I shuodl be doing this in the BADI, how do I do it. A simple example is that I have created a field called ZZ_CUST_TIME in LIKP, added it to my sub-screen using data dictionary linking.

How do I pass a value entered into this field via VL02N back to the transaction for update?

Any suggestions would be greatfully appreciated.

Regards,

Steve

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Stephen,

You can do it by using PBO and PAI modules of the screen that you created. But you have to transfer the data from subscreen to the BADI method TRANSFER_DATA_FROM_SUBSCREEN and aslo from method TRANSFER_DATA_TO_SUBSCREEN to the subscreen. This will update the screen field data to LIKP.

You can aceive this by two ways.

1) You can use EXPORT in method TRANSFER_DATA_TO_SUBSCREEN and then IMPORT the value in the screen PBO. And You can EXPORT data from screen PAI and IMPORT data in method TRANSFER_DATA_FROM_SUBSCREEN.

2) Anither way to do it is by using Function modules and Function Group instead of EXPORT/IMPORT.

Create a Function group. In the global data define a structure/Work Area of type LIKP.


DATA w_likp TYPE likp.

Then create two Function modules, one to export data and another to import data.

Let us assume that the export FM takes in IS_LIKP as input and the import FM outputs the value of LIKP into ES_LIKP.

Then pass the value is_likp to the export FM in the BADI method TRANSFER_DATA_TO_SUBSCREEN and in the screen PAI pass the LIKP data to the export FM.

In the export Function module write the following code:


MOVE is_likp TO w_likp

Then in the Import FM write the following code:


MOVE w_likp TO es_likp.

.

The import FM is called from method TRANSFER_DATA_FROM_SUBSCREEN and from screen PBO.

This will solve your problem.

Regards,

Abhisek.

6 REPLIES 6

Former Member
0 Kudos

Hi Stephen,

For more information on implementation of BADI LE_SHP_TAB_CUST_HEAD, just check out the link:

Hope this will help you in some way......

Former Member
0 Kudos

Hi Stephen,

You can do it by using PBO and PAI modules of the screen that you created. But you have to transfer the data from subscreen to the BADI method TRANSFER_DATA_FROM_SUBSCREEN and aslo from method TRANSFER_DATA_TO_SUBSCREEN to the subscreen. This will update the screen field data to LIKP.

You can aceive this by two ways.

1) You can use EXPORT in method TRANSFER_DATA_TO_SUBSCREEN and then IMPORT the value in the screen PBO. And You can EXPORT data from screen PAI and IMPORT data in method TRANSFER_DATA_FROM_SUBSCREEN.

2) Anither way to do it is by using Function modules and Function Group instead of EXPORT/IMPORT.

Create a Function group. In the global data define a structure/Work Area of type LIKP.


DATA w_likp TYPE likp.

Then create two Function modules, one to export data and another to import data.

Let us assume that the export FM takes in IS_LIKP as input and the import FM outputs the value of LIKP into ES_LIKP.

Then pass the value is_likp to the export FM in the BADI method TRANSFER_DATA_TO_SUBSCREEN and in the screen PAI pass the LIKP data to the export FM.

In the export Function module write the following code:


MOVE is_likp TO w_likp

Then in the Import FM write the following code:


MOVE w_likp TO es_likp.

.

The import FM is called from method TRANSFER_DATA_FROM_SUBSCREEN and from screen PBO.

This will solve your problem.

Regards,

Abhisek.

0 Kudos

Abishek,

Thank you for your detailed response. It goes a long way to resolving my issue. The remaining questions I have is, if I use the FM method and transfer the IS_LIKP data to a local structure w_likp,

do the fields on my subscreen have to reference the w_likp custom fields? Presently, they are defined pointing to the LIKP table fields.

Regards,

Steve

Former Member
0 Kudos

Please ignore my previous question. Your detailed explanation has resolved my problem.

Thank you all for your time.

Regards,

Steve

Former Member
0 Kudos

Dear Abhishek,  can you explain the step..in this step screen is comming but custom fields value is not coming and also likp table is not updated

Correct AnswerRe: Update and transfer data via BADI LE_SHP_TAB_CUST_HEAD

Former MemberBronze

Hi Stephen,

You can do it by using PBO and PAI modules of the screen that you created. But you have to transfer the data from subscreen to the BADI method TRANSFER_DATA_FROM_SUBSCREEN and aslo from method TRANSFER_DATA_TO_SUBSCREEN to the subscreen. This will update the screen field data to LIKP.

You can aceive this by two ways.

1) You can use EXPORT in method TRANSFER_DATA_TO_SUBSCREEN and then IMPORT the value in the screen PBO. And You can EXPORT data from screen PAI and IMPORT data in method TRANSFER_DATA_FROM_SUBSCREEN.

2) Anither way to do it is by using Function modules and Function Group instead of EXPORT/IMPORT.

Create a Function group. In the global data define a structure/Work Area of type LIKP.

DATA w_likp TYPE likp.

Then create two Function modules, one to export data and another to import data.

Let us assume that the export FM takes in IS_LIKP as input and the import FM outputs the value of LIKP into ES_LIKP.

Then pass the value is_likp to the export FM in the BADI method TRANSFER_DATA_TO_SUBSCREEN and in the screen PAI pass the LIKP data to the export FM.

In the export Function module write the following code:

MOVE is_likp TO w_likp

Then in the Import FM write the following code:

MOVE w_likp TO es_likp.

.

The import FM is called from method TRANSFER_DATA_FROM_SUBSCREEN and from screen PBO.

This will solve your problem.

Regards,

Abhisek.

Former Member
0 Kudos

Dear Stephen Keam,

i have faced same problem but when the bdc executing the subscreen(custom field) no value is showing except the manually created value by vl01n.