2015 Sep 30 8:40 AM
Hi All,
I have created a subscreen in the transactions XD01-03 using BADI CUSTOMER_ADD_DATA_CS. In the method get_taxi_screen i have given the custom program name and the subscreen number i have created.
Problem: I want to get the customer number of the main program in the subscreen program. Based on that customer number i process the data in the subscreen program.
Please share the information if you know how to do it.
Thanks & regards,
NarsiReddy.
2015 Sep 30 9:32 AM
In CUSTOMER_ADD_DATA_CS implementation, use method IF_EX_CUSTOMER_ADD_DATA_CS~SET_DATA to pass data from main transaction program to your implementation, and GET_DATA to send changed data back.
Hint: Easiest solution is to create a function group to contain the customer subscreen, and 2 FM to be called from mentioned method and save/read data in global area of FM. If you didn't use a function group but a module pool, you could try to export/import those data into/from memory during your PBO/PAI logic.
Remarks
Regards,
Raymond
Hi All,
I have created a subscreen in the transactions XD01-03 using BADI CUSTOMER_ADD_DATA_CS. In the method get_taxi_screen i have given the custom program name and the subscreen number i have created.
Problem: I want to get the customer number of the main program in the subscreen program. Based on that customer number i process the data in the subscreen program.
Please share the information if you know how to do it.
Thanks & regards,
NarsiReddy.
2015 Sep 30 8:57 AM
Hi,
you Need to implement method SET_DATA in the same BADI. This method gets all data used in Transaction XD0x so you can write the Information to global fields in your custom program.
Regards
Oliver
2015 Sep 30 9:08 AM
Hi Oliver,
Thanks for the quick reply.
Can you please explain it a bit more, for example i create a global field gv_kunnr in the top include of the custom subscreen program.
How to set the data from set_data method to the global variable.
Thanks in advance,
regards,
NarsiReddy.,
2015 Sep 30 9:13 AM
Hi,
you can create a FORM in your custom program which you call out of the SET_DATA Method. You pass everything you need to that FORM and the FORM populates the global data fields declared in your TOP include.
Regards
Oliver
2015 Sep 30 9:32 AM
In CUSTOMER_ADD_DATA_CS implementation, use method IF_EX_CUSTOMER_ADD_DATA_CS~SET_DATA to pass data from main transaction program to your implementation, and GET_DATA to send changed data back.
Hint: Easiest solution is to create a function group to contain the customer subscreen, and 2 FM to be called from mentioned method and save/read data in global area of FM. If you didn't use a function group but a module pool, you could try to export/import those data into/from memory during your PBO/PAI logic.
Remarks
Regards,
Raymond
2015 Sep 30 9:56 AM
Hi Raymond,
I am using Module pool. I am not changing any data of the database tables and i don't write any data to them as well. I just need to know the customer number. Using this customer number, i will make changes to my custom table in the PBO of my subscreen.
Depending on the customer number, i will display an alv table(custom table) and if user makes any changes to it, i will just update my custom table.
So in the IF_EX_CUSTOMER_ADD_DATA_CS~SET_DATA i exported like below.
EXPORT s_kna1-kunnr FROM s_kna1 TO MEMORY id 'ADD_CUS_123'.
In the PBO of the subscreen i have imported as below:
IMPORT s_kna1-kunnr TO gv_kunnr FROM MEMORY ID 'ADD_CUS_123'.
gv_kunnr is a global variable of type kunnr, i declared in the top include. I am getting short dump when executing this Import.
Do i need to export and import the whole table?
Thanks & regards,
NarsiReddy.
2015 Sep 30 10:07 AM
Hi Raymond,
its working fine now.
In IF_EX_CUSTOMER_ADD_DATA_CS~SET_DATA i have exported the customer number.
DATA: gv_kunnr TYPE kna1-kunnr.
gv_kunnr = s_kna1-kunnr.
EXPORT gv_kunnr FROM gv_kunnr TO MEMORY id 'ADD_CUS_123'.
and in the PBO of the subscreen i have imported the customer number.
IMPORT gv_kunnr to gv_kunnr FROM MEMORY ID 'ADD_CUS_123'.
gv_kunnr is declared of type kna1-kunnr in the top include.
Thank you.
regards,
NarsiReddy.
2015 Sep 30 10:13 AM
Well today you only require the customer number, but can you sure, you won't need more information in the future?
Also, i didn't think on an alternative to EXPORT/IMPORT, you could execute a FORM of your module pool in the method.
PERFORM myform IN PROGRAM sapmzmyprog USING kna1-kunnr.
Regards,
Raymond
2015 Sep 30 10:06 AM
Hi,
If you can check the parameter ID you will find the same. KUN is the parameter id.
Thanks
Nishant
2015 Sep 30 10:09 AM
Hi Nishant,
How to do in this way?
setting parameter id? what do we need to do in the IF_EX_CUSTOMER_ADD_DATA_CS~SET_DATA and in the PBO of our subscreen.
Thanks & regards,
NarsiReddy.
2015 Sep 30 10:33 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |