2007 Dec 10 7:45 AM
hi frnds,
i want to develop a program for testing purpose.
on executing the code.
a sceen opens in which i will enter material no(matnr) as parameter.
on pressing enter again a new screen will open which will show materials description (makt-maktx) along with mateial no(this field will grey out).
i will be able to change materials description and will save it and the data shuld be updated in database table.
<b>pls dont design the screen by going to scrrn painter (using module pool concept)</b> . how to achieve this
pls help
thanks
pankaj
pankaj
On getting the data of material number and material description in the Internal table
write the output as
loop at itab.
write : itab-matnr, itab-matkx input on.
endloop.
Now change the value on screen .. on the event for pusbutton
at user-command
case sy-ucomm.
when 'submit'.
use Read line statement to get the changed value . Compare the changed value with the value in the internal table . If any changes Update in the database
2007 Dec 10 7:55 AM
pankaj
On getting the data of material number and material description in the Internal table
write the output as
loop at itab.
write : itab-matnr, itab-matkx input on.
endloop.
Now change the value on screen .. on the event for pusbutton
at user-command
case sy-ucomm.
when 'submit'.
use Read line statement to get the changed value . Compare the changed value with the value in the internal table . If any changes Update in the database
2007 Dec 10 8:01 AM
Hi mohit sir,
can u give me the code after which i have to use after submit
thanks
pankaj
2007 Dec 10 7:57 AM
You could achieve that by "playing" with AT SELECTION-SCREEN OUTPUIT.
Declare two parameters maternial no and text.
Attach a group to parameter material no and another to text
AT SELECTION SCREEN OUTPUT - LOOP AT SCREEN
First call
- set material input flag
- set text as inactive
Second call
- clear material input flag
- set text as active (and input)
When okay use a call transaction or a BAPI (BAPI_MATERIAL_SAVEDATA) to update material text.
Regards
2007 Dec 10 7:59 AM
Hi,
parameters:
s_matnr type matnr.
at selection-screen.
select single matnr
maktx
into fs_tab-maktx
where matnr = s_matnr.
start-of-selection.
write: /n p_matnr, fs_tab-maktx.
at line selection.
write: /n p_matnr, fs_tab-maktx as input.
hide fs_tab-maktx.
then use the update maktx from fs_tab.
i hope this will helpful for u.
plzz reward points if it is useful.
2007 Dec 10 8:08 AM
Hi,
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.
PARAMETERS : p_pay1 RADIOBUTTON GROUP grp USER-COMMAND fc DEFAULT 'X',
p_pay2 RADIOBUTTON GROUP grp.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_pernr FOR pa0000-pernr. "Personnel Number
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (31) text-018.
PARAMETERS : p_begda LIKE pa0000-begda OBLIGATORY. "Start Date
SELECTION-SCREEN COMMENT 52(05) text-019.
PARAMETERS : p_endda LIKE pa0000-endda OBLIGATORY. "End Date
SELECTION-SCREEN END OF LINE.
SELECT-OPTIONS : s_stat2 FOR pa0000-stat2, "Status
s_werks FOR pa0001-werks, "Personnel Area
s_raufnr FOR catsdb-raufnr MODIF ID md1. "Internal Order Number
SELECTION-SCREEN END OF BLOCK b2.
----
AT SELECTION-SCREEN *
----
AT SELECTION-SCREEN OUTPUT.
IF p_pay1 EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'MD1'.
screen-active = '1'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF p_pay2 EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'MD1'.
screen-active = '1'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards,
PRashant
Message was edited by:
Prashant Patil
2007 Dec 10 8:54 AM
REPORT YTEST33.
Types : begin of ty_itab,
p1 type i,
p2 type i,
end of ty_itab.
data : itab type standard table of ty_itab initial size 0 with header line.
data : line_count type i,temp_p2 type i.
data : i1 type i value 1.
itab-p1 = 1.
itab-p2 = 2.
append itab.
itab-p1 = 3.
itab-p2 = 4.
append itab.
itab-p1 = 5.
itab-p2 = 6.
append itab.
start-of-selection.
loop at itab.
write : /10 itab-p1 , itab-p2 input on.
endloop.
describe table itab lines Line_count.
at pf06.
while ( i1 <= line_count ).
read table itab index i1.
i1 = i1 + 1.
read line i1 field value itab-p2 into temp_p2. "reading value changed
if ( temp_p2 <> itab-p2 ).
" write code for update in database
endif.
endwhile.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |