‎2007 May 15 4:46 PM
Hi,
I have 2 radio buttons on the screens and 3 quantity fields.
I have to enter these 3 quantity fields for these 2 radio buttons....can some one plz send the code...
I am having problem when i am switching between these 2 radio buttons.
Thanks.
‎2007 May 15 9:25 PM
Hi,
You might have to modify couple of user exits..
<b>In the include MV45ATZZ..Declare the internal table</b>
DATA: T_ZTABLE TYPE STANDARD TABLE OF ZTABLE.
<b>In the user exit USEREXIT_READ_DOCUMENT..Move the data.</b>
SELECT * FROM
ZTABLE INTO TABLE T_ZTABLE
WHERE VBELN = VBAK-VBELN.
IF SY-SUBRC = 0.
SORT T_ZTABLE BY VBELN POSNR.
ENDIF.
<b>In the PBO of the screen...Create a module to move the data.</b>
MODULE move_data.
MODULE move_data OUTPUT.
DATA: WA TYPE ZTABLE.
* Get the line item data.
READ TABLE T_ZTABLE INTO WA INDEX svbap-tabix.
* Move the values to the screen structure from the work area WA.
ENDMODULE.
<b>In the PAI of the screen.</b>
MODULE modify_data.
MODULE modify_data INPUT.
DATA: WA TYPE ZTABLE.
* Move the values from the screen structure to the work area WA.
MODIFY T_ZTABLE FROM WA
INDEX svbap-tabix
TRANSPORTING QTY1 QTY2 QTY3.
ENDMODULE.
<b>In the user exit USEREXIT_SAVE_DOCUMENT.</b>
* Modify the z table with the new values.
MODIFY ZTABLE FROM TABLE T_ZTABLE.
Hope this works..
Thanks,
Naren
‎2007 May 15 4:48 PM
‎2007 May 15 4:56 PM
I am changing va02 screen...
I have R1 , R2 as radio buttons and Q1, Q2, Q3 as text fields.
In PBO,
I am fetching data which is stored in Ztable by default to these Q1, Q2, Q3.
In PAI,
By Default R1 will be selected.
I am entering some values to Q1, Q2, Q3 and pressing enter ...I am collecting this data in internal table itab1.
If I select R2, I have to get by default values which are stored in Ztable for that R2 selection and get by default data for R2. Here again I am changing some value,
So, again this data has to be collected in itab1 for R2 selection.
Again if i go back to R1, the screen fields data is not coming properly.
‎2007 May 15 5:18 PM
Hi
It's not very clear your problem, anyway I suppose you need to refresh your internal table when a radiobutton R1 or R2 is selected to load the data and collect them in an internal table again.
Max
‎2007 May 15 5:36 PM
Hi Max and Narendra,
Here is my requirement: -
I created a ZTEST table where i am having entries like vbeln, posnr, sourcetype, q1, a2, q3.
Where sourcetype have the entries 0 or 1.
If it is 0 - It should be the first radio button i.e, R1
1 - It should be the second radio button i.e, R2.
Now i have in ZTEST table ....The entries are:-
VBELN | POSNR | sourcetype | Q1 | Q2 | Q3
00000136 | 0000010 | 0 | 10 | 20 | 30
00000136 | 0000010 | 1 | 15 | 16 | 17
In va02: -
In PBO: - By default R1 will be selected...So, the first the first entry should appear on the screen...
select * from ztest into itab1.
ZTEST-Q1 = itab1-q1.
ZTEST-Q2 = itab1-q2.
ZTEST-Q3 = itab1-q3.
PAI: -
.Now if i change these Q1, Q2, Q3 values....I have to collect this data in int. table
Again if i select radio buttton R2, by default it has to come from again ZTEST table here. Now if change any value in Q1, Q2, Q3 for R2 selection ....again it has to be collected in PAI,,,,,itab.
itab1-q1 = ZTEST-Q1.
itab1-q2 = ZTEST-Q2 .
itab1-q3 = ZTEST-Q3.
MODIFY itab1.
When pressing save --this ll be saved to ZTEST db.
‎2007 May 15 6:41 PM
‎2007 May 15 4:50 PM
Hi,
If the quantity fields are required for both the radio buttons...In the quantity field attributes check the Required flag..
OR
Try this code..
In the PAI event check if the quantity is entered..
Ex..
PROCESS AFTER INPUT.
CHAIN.
FIELD: QTY1,
QTY2,
QTY3.
MODULE check_data.
ENDCHAIN.
* PAI Module
MODULE check_data INPUT.
* Check for the qty fields.
IF QTY1 IS INITIAL OR
QTY2 IS INITIAL OR
QTY3 IS INITIAL.
* Error message.
MESSAGE E208(00) 'All the quantity fields are required'.
ENDIF.
ENDMODULE.
Thanks,
Naren
‎2007 May 15 5:08 PM
Hi Narendra,
The quantity fields are not a mandatory one.
But if he enters...this has to be saved for both the radio buttons.
Please let me know if i explanation is not clear...
Thanks.
‎2007 May 15 5:17 PM
Hi,
Ok..If you change back to R1...is it getting from the database again..Instead of displaying the modified data..
Please let me know if I am correct??
Thanks
Naren
‎2007 May 15 9:25 PM
Hi,
You might have to modify couple of user exits..
<b>In the include MV45ATZZ..Declare the internal table</b>
DATA: T_ZTABLE TYPE STANDARD TABLE OF ZTABLE.
<b>In the user exit USEREXIT_READ_DOCUMENT..Move the data.</b>
SELECT * FROM
ZTABLE INTO TABLE T_ZTABLE
WHERE VBELN = VBAK-VBELN.
IF SY-SUBRC = 0.
SORT T_ZTABLE BY VBELN POSNR.
ENDIF.
<b>In the PBO of the screen...Create a module to move the data.</b>
MODULE move_data.
MODULE move_data OUTPUT.
DATA: WA TYPE ZTABLE.
* Get the line item data.
READ TABLE T_ZTABLE INTO WA INDEX svbap-tabix.
* Move the values to the screen structure from the work area WA.
ENDMODULE.
<b>In the PAI of the screen.</b>
MODULE modify_data.
MODULE modify_data INPUT.
DATA: WA TYPE ZTABLE.
* Move the values from the screen structure to the work area WA.
MODIFY T_ZTABLE FROM WA
INDEX svbap-tabix
TRANSPORTING QTY1 QTY2 QTY3.
ENDMODULE.
<b>In the user exit USEREXIT_SAVE_DOCUMENT.</b>
* Modify the z table with the new values.
MODIFY ZTABLE FROM TABLE T_ZTABLE.
Hope this works..
Thanks,
Naren