09-11-2008 7:17 AM
in my selection screen i have 3 feilds-- billing doc no(vbrk-vbeln), customer no(kna1-kunnr) and customer name(kna1-name1).
i have made a ztable with this 3 feilds. now whenever user executes the report after giving values in the screen, the
feilds in my ztable should be updated with the user entered bill doc no, custno and name.how to do this..
09-11-2008 7:20 AM
Hi narayan,
Declare one internal table with 3 fields and retrieve selection screen fields values to internal table and update with Ztable with Internal Table , if u need code ask me.
Regards
Jana
Edited by: Janardhan Reddy on Sep 11, 2008 11:50 AM
09-11-2008 7:24 AM
hi...
you can fetch the slection screens value in a varialbe and upadte your table using rthat varialbe...
that should be one of the solution...
09-11-2008 7:30 AM
Hi,
What is your table's primary key and if just update needed you have to specify the key field as obligatory and update then.
I assume vbeln is your key, so:
Update ztable set kunnr = p_kunnr name1 = p_name1
where vbeln = p_vbeln.
Try this.It will work.
deniz.
09-11-2008 7:32 AM
Hi,
What u can do is , save the values entered by the user in internal table fields.
From internal table insert it into Ztable.
All the best.
Mohammadi.
09-11-2008 7:39 AM
Hi,
First of all declare one internal table with 3 fields that you need and retrieve selection screen fields values to internal table and update with Ztable with Internal Table. in your case you need to either use JOIN or FOR ALL ENTRIES.. as 2 tables are involved
example:
select avbeln bkunnr b~name1
from vbrk as a INNER JOIN kna1 as b
ON .....
into table itab1
where a~vbeln = p_vblen
and b~kunnr = p_kunnr
and b_name1 = p_name1.
if sy0subrc = 0.
" then use update command to update the ztable .
Update ztable from table itab1.
IF sy-subrc EQ 0.
COMMIT WORK.
l_error = 'X1'.
ELSE.
l_error = 'X2'.
CLEAR l_error.
ROLLBACK WORK.
ENDIF.
endif.
its not the whole code you need to find common fiels in tables vbrk and kna1 that we need to join.
thanx.
Edited by: Dhanashri Pawar on Sep 11, 2008 8:40 AM
09-11-2008 8:22 AM
in my selection screen i have 3 feilds-- billing doc no(vbrk-vbeln), customer no(kna1-kunnr) and customer name(kna1-name1).
i have made a ztable with this 3 feilds. now whenever user executes the report after giving values in the screen, the
feilds in my ztable should be updated with the user entered bill doc no, custno and name.how to do this..
Hi
Store the values from the selection screen to a structure of type ZTABLE. (here structure because i think only one set of values is possible from ur selection screen...if u have multiple then store it in a internal table)
Enque/deque your ZTABLE. In between these functions modify ur ztable using the structure (if it is not initial).
09-11-2008 8:25 AM
Move pa_matnr to ztable-matnr.
assuming the ztable has a field matnr.
insert ztable.
if sy-subrc = 0.
commit work.
endif.
if more fields move it to table header and do insert.
09-11-2008 7:18 PM
09-11-2008 7:19 PM