08-02-2007 10:54 AM
Hi experts!,
I have a internal table in my abab and I want to create a popup window when user can select different rows and then read this selected rows.
I created a dynpro (100) with a table control but I don't know how I can pass my internal table to dynpro.
A lot of thanks in advance.
Regards.
08-02-2007 10:58 AM
hi ,
I hope your table control structure and the structure of of the internal table are same . then in PBO of your screen flow logic you loop at the itab and pass the values to the table control .
Revert back if further assistance needed .
Regards,
Ranjita
08-02-2007 10:58 AM
hi ,
I hope your table control structure and the structure of of the internal table are same . then in PBO of your screen flow logic you loop at the itab and pass the values to the table control .
Revert back if further assistance needed .
Regards,
Ranjita
08-02-2007 11:25 AM
Hi Ranjita Kar!,
Thanks for your reply. Can you explain me a little bit more? When user select values How I can read this in my abab program?
Thanks in advance.
Regards
08-02-2007 12:19 PM
hi ,
You put a select column on your table control ,and you declare a variable of type CHAR , lets say SEL . declare it in your TOP include .
Add a field ' SEL ' to the structure of the internal table.( Remember that all the rows present in your table control are passed back to the intarnal table you are using , do this in the PAI of screen 100 ) . Now , when you select the rows in the table control , the SEL field values will have ' X' in it .
so .. Loop at the internal table where SEL = 'X ' ( here you are capturing the selected rows ) . and this way you can read the selected rows in your ABAP program .
Revert back if further help needed .
Ranjita
08-02-2007 11:00 AM
Hi,
Refer belo coding from another theard
HI
Check this example
&----
*& *
&----
*& *
*& *
&----
PROGRAM ZTRANS_50572 message-id zz .
*Tables.
tables: vbak, knvv.
*Declaration of variables
data: v_kunnr type kna1-kunnr,
v_vkorg type knvv-vkorg,
v_vtweg type knvv-vtweg,
v_spart type knvv-spart,
okcode like sy-ucomm,
v_dynnr like sy-dynnr,
sel type c.
*Declaration of Internal tables for transactions.
data: begin of it_knvv occurs 0,
kunnr like kna1-kunnr,
vkorg like knvv-vkorg,
vtweg like knvv-vtweg,
spart like knvv-spart,
end of it_knvv.
data: begin of it_vbak occurs 0,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
ernam like vbak-ernam,
audat like vbak-audat,
auart like vbak-auart,
bstnk like vbak-bstnk,
bstdk like vbak-bstdk,
kalsm like vbak-kalsm,
kokrs like vbak-kokrs,
bukrs_vf like vbak-bukrs_vf,
chk type c,
end of it_vbak.
*CONTROL STATEMENT FOR THE TABLE CONTROL.
controls tc type tableview using screen 0300.
&----
*& Module STATUS_0100 OUTPUT
&----
Setting the PF status for the screen
----
module STATUS_0100 output.
SET PF-STATUS 'FF'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_0100 OUTPUT
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
module USER_COMMAND_0100 input.
*Validating customer no whether present in table kna1.
SELECT KUNNR INTO V_KUNNR FROM KNA1 WHERE KUNNR = V_KUNNR.
IF SY-SUBRC <> 0.
MESSAGE E000(ZZ) with 'Invalid Customer'.
endif.
endselect.
*When it is in display mode it will show in display mode else
*show it in change mode
case sy-ucomm.
when 'DISPLAY' or 'CHANGE'.
IF V_KUNNR IS NOT INITIAL.
v_dynnr = 300.
*selecting data from the table vbak into internal table.
select vbeln
erdat
ernam
audat
auart
bstnk
bstdk
kalsm
kokrs
bukrs_vf into table it_vbak
from vbak.
move sy-ucomm to okcode.
leave to screen 0200.
endif.
when 'BACK'.
leave program.
when 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
module STATUS_0200 output.
SET PF-STATUS 'SS'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_0200 OUTPUT
&----
*& Module USER_COMMAND_0200 INPUT
&----
text
----
module USER_COMMAND_0200 input.
case sy-ucomm.
when 'BACK'.
leave to screen 100.
when 'EXIT'.
leave to screen 0.
when 'CANCEL'.
leave to screen 0.
endcase.
endmodule. " USER_COMMAND_0200 INPUT
&----
*& Module STATUS_0300 OUTPUT
&----
text
----
module STATUS_0300 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_0300 OUTPUT
&----
*& Module USER_COMMAND_0300 INPUT
&----
text
----
module USER_COMMAND_0300 input.
case sy-ucomm.
when 'DISPLAY'.
IF V_DYNNR = 300.
LOOP AT SCREEN.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
endcase.
endmodule. " USER_COMMAND_0300 INPUT
&----
*& Module MOD2 INPUT
&----
text
----
module MOD2 input.
*Validating sales organization.
SELECT VKORG INTO V_VKORG FROM TVKO WHERE VKORG = V_VKORG.
IF SY-SUBRC <> 0.
MESSAGE E000(ZZ) WITH 'Invalid Sales organization'.
endif.
endselect.
endmodule. " MOD2 INPUT
&----
*& Module MOD3 INPUT
&----
text
----
module MOD3 input.
*Validating distribution channel.
SELECT VTWEG INTO V_VTWEG FROM TVTW WHERE VTWEG = V_VTWEG.
IF SY-SUBRC <> 0.
MESSAGE E000(ZZ) WITH 'Invalid distribution channel'.
endif.
endselect.
endmodule. " MOD3 INPUT
&----
*& Module MOD4 INPUT
&----
text
----
module MOD4 input.
*Validating division.
SELECT SPART INTO V_SPART FROM TVTA WHERE SPART = V_SPART.
IF SY-SUBRC <> 0.
MESSAGE E000(ZZ) WITH 'Invalid division'.
endif.
endselect.
endmodule. " MOD4 INPUT
Refer below theard:
https://forums.sdn.sap.com/click.jspa?searchID=4277489&messageID=3346695
Regards
08-02-2007 11:01 AM
Hi,
Use below function module to display internal table data and select
POPUP_WITH_TABLE_DISPLAY_OK
POPUP_WITH_TABLE
Regards,
Sankar
08-02-2007 11:21 AM
I need to know more than one entry this functions:
POPUP_WITH_TABLE_DISPLAY_OK
POPUP_WITH_TABLE
Returns only one selection.