Dynamic display in table control
hi all,
i hav an issue regarding Module Pool programming. i wnt 2 disply table control with dynamic enteries both at header level and the content level, ie. the values of the heading shud com 4m an internal table and the values a user enters shud go 2 another internal tab. i cannot take the values of one column of d tab contrl in a diff internal tab n so on for all headers.
See dis ll b design format,
Screen 1 delivrry no._________
In PAI itll find total no. of material no. n other details.
Screen 2. (header) <b>matnr1</b> <b>matnr2</b> <b>matnr3</b>
(cmng from int tab 1 on which d loop is defined in PBO of screen 2)
<b>Ser1 Ser2 Ser3 </b> (entered by the user)
<b>Ser11 Ser22</b>
<b>Ser12</b>
<b>button</b>( to tk this combination in one int table in the followng format for running it in BDC)
matnr1 Ser1
matnr1 Ser11
matnr1 Ser12
matnr2 Ser2
matnr2 Ser22
matnr3 Ser3
revert if nt clear
Similar Messages
-
Dynamic extending of table control in bdc
hi frnds
I want an example of dynamic extension of table control i.e
for example:In xk01 there is table control with bank details.
i have to upload upto 10 bank details of a record. I have searched in forum.I got the hint of 'p+' but i cant understand that.so please send me sample code
Thanks
RaghavHai,
Chech this sample code.
Check the below link.
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
THis is example to upload the Bank details of the Vendor which has the TC.
REPORT zprataptable2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
DATA : c TYPE i.
INCLUDE bdcrecx1.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
itab-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
itab-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
itab-sortl.
PERFORM bdc_field USING 'LFA1-LAND1'
itab-land1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFB1-AKONT'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFM1-WAERS'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.
Header file:
1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr
TC file:
1 in sb 11000
1 in sb 12000
1 in sb 13000
1 in sb 14000
1 in sb 15000
1 in sb 16000
1 in sb 17000
1 in sb 18000
1 in sb 19000
1 in sb 20000
1 in sb 21000
1 in sb 22000
2 in sb 21000
2 in sb 22000
REPORT zmm_pr_upload_mat
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_pr OCCURS 0,
Header Screen
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
lpein(001), " Category of Del Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
Item Details
matnr(018), " Material No
menge(017), " Quantity
badat(010),
frgdt(010),
preis(014), " Valuation Price
waers(005), " Currency
peinh(005),
wepos(001),
repos(001),
sakto(010), " GL Account
kostl(010), " Cost Center
bnfpo(005),
END OF i_pr.
Internal Table for header Data
DATA: BEGIN OF it_header OCCURS 0,
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
END OF it_header.
Internal Table for Item Data
DATA: BEGIN OF it_item OCCURS 0,
sno(3), " SNo
matnr(018), " Material No
menge(017), " Quantity
preis(014), " Valuation Price
sakto(010), " GL Account
kostl(010), " Cost Center
END OF it_item.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
DATA : v_l(2), " Counter
v_rowno(5), " Row No
v_2(2), " Counter
v_rows LIKE sy-srows, " Rows in TC
v_field(45). " String
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_pr
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT i_pr BY sno.
LOOP AT i_pr.
MOVE-CORRESPONDING i_pr TO it_item.
APPEND it_item.
CLEAR it_item.
AT END OF sno.
READ TABLE i_pr INDEX sy-tabix.
MOVE-CORRESPONDING i_pr TO it_header.
APPEND it_header.
CLEAR it_header.
ENDAT.
ENDLOOP.
SORT it_header BY sno.
SORT it_item BY sno.
v_rows = sy-srows - 6.
Upload the Data from Internal Table
LOOP AT it_header.
Header Data
PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BEDNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-BSART'
it_header-bsart.
PERFORM bdc_field USING 'RM06B-EPSTP'
it_header-epstp.
PERFORM bdc_field USING 'EBAN-KNTTP'
it_header-knttp.
PERFORM bdc_field USING 'RM06B-EEIND'
it_header-eeind.
PERFORM bdc_field USING 'RM06B-LPEIN'
it_header-lpein.
PERFORM bdc_field USING 'EBAN-WERKS'
it_header-werks.
PERFORM bdc_field USING 'EBAN-LGORT'
it_header-lgort.
PERFORM bdc_field USING 'EBAN-EKGRP'
it_header-ekgrp.
PERFORM bdc_field USING 'EBAN-MATKL'
it_header-matkl.
PERFORM bdc_field USING 'EBAN-BEDNR'
it_header-bednr.
PERFORM bdc_field USING 'EBAN-AFNAM'
it_header-afnam.
Item Details
v_l = 0.
To add no. of rows
v_2 = 0 .
As the screen is showing 13 rows defaulted to 130
v_rowno = 130 .
LOOP AT it_item WHERE sno = it_header-sno.
v_l = v_l + 1.
IF v_l = 14 .
IF v_2 = 12 .
v_2 = 12 .
v_l = 2 .
From second time onwards it is displaying 12 rows only
v_rowno = v_rowno + 120 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ELSE.
V_2 initialized to 12 for second screen purpose
v_2 = 12 .
v_l = 2 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno .
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CLEAR v_field.
CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-matnr.
CLEAR v_field.
CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-menge.
PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-PREIS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-PREIS'
it_item-preis.
PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBKN-SAKTO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'EBKN-SAKTO'
it_item-sakto.
Cost Center
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-KOSTL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-KOSTL'
it_item-kostl.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
Call The Transaction
PERFORM bdc_transaction USING 'ME51'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
with regards.
sowjanya.b. -
How to display a table control in a report
hi
how to display a table control in a reportcreate a screen in your report.
Call that screen in your report.
While designing your screen, use Table control creation wizard to create table control on that screen.
http://www.planetsap.com/online_pgm_main_page.htm -
Dynamic headers in table control
Hi,
How to create dynamic headers in table control headers?
I have to replace the header labels with internally computed headers.
I have created input fields for headers..
Regards,
KrutikaHi Krutika,
Try this out,
Populate an internal tabel with all the dates and day in it and also populate the column position in it.
say you have populated all this in an internal table it_date----fields in the internal table
1. date
2. day
3. spot1 -
column name of the table control(spot1 represents the column position)
then do this ,
LOOP AT it_date INTO wa_date.
LOOP AT SCREEN .
*WHERE screen-name = wa_date-spot.
CASE wa_date-spot.
WHEN 'SPOTS1'.
spots1 = wa_date-dd.
WHEN 'SPOTS2'.
spots2 = wa_date-dd.
WHEN 'SPOTS3'.
spots3 = wa_date-dd.
WHEN 'SPOTS4'.
spots4 = wa_date-dd.
WHEN 'SPOTS5'.
spots5 = wa_date-dd.
WHEN 'SPOTS6'.
spots6 = wa_date-dd.
WHEN 'SPOTS7'.
spots7 = wa_date-dd.
WHEN 'SPOTS8'.
spots8 = wa_date-dd.
WHEN 'SPOTS9'.
spots9 = wa_date-dd.
WHEN 'SPOTS10'.
spots10 = wa_date-dd.
WHEN 'SPOTS11'.
spots11 = wa_date-dd.
WHEN 'SPOTS12'.
spots12 = wa_date-dd.
WHEN 'SPOTS13'.
spots13 = wa_date-dd.
WHEN 'SPOTS14'.
spots14 = wa_date-dd.
WHEN 'SPOTS15'.
spots15 = wa_date-dd.
WHEN 'SPOTS16'.
spots16 = wa_date-dd.
WHEN 'SPOTS17'.
spots17 = wa_date-dd.
WHEN 'SPOTS18'.
spots18 = wa_date-dd.
WHEN 'SPOTS19'.
spots19 = wa_date-dd.
WHEN 'SPOTS20'.
spots20 = wa_date-dd.
WHEN 'SPOTS21'.
spots21 = wa_date-dd.
WHEN 'SPOTS22'.
spots22 = wa_date-dd.
WHEN 'SPOTS23'.
spots23 = wa_date-dd.
WHEN 'SPOTS24'.
spots24 = wa_date-dd.
WHEN 'SPOTS25'.
spots25 = wa_date-dd.
WHEN 'SPOTS26'.
spots26 = wa_date-dd.
WHEN 'SPOTS27'.
spots27 = wa_date-dd.
WHEN 'SPOTS28'.
spots28 = wa_date-dd.
WHEN 'SPOTS29'.
spots29 = wa_date-dd.
WHEN 'SPOTS30'.
spots30 = wa_date-dd.
WHEN 'SPOTS31'.
spots31 = wa_date-dd.
ENDCASE.
Hope this helps you,
Regards,
Abhijit G. Borkar -
How to control the display of table control
hi,
If I dont find any entry in the internal table to be displayed in table control then I should not display the blank table in the screen.
I tried using if not itab[] is initial in PBO but there(PBO) 'if' is not recognised and it gives syntax error.
Even if I tried to put the code of table control 'loop at itab[] into wa_tab contrl....'this part in a module and there to put the If condition it gives error to put where after wa_tab.
Thanks,
mohanhi,
As i told i had put the if part in the module but then it is the error with syntax check of table control as shown below
PBO
module pbo_100.
loop at itab into wa with contril Tc cursor tc-lines.
endloop
pai
module pai_100
but here if i create a new module in PBO say module check_table and put the code for table control as
if not itab is initial
loop at itab into wa with contril Tc cursor tc-lines.
endloop
endif.
then here error comed with syntax of loop at itab into wa has to be 'where' condition.
So the problem is i dont want to display the table control in 1st but after some input on the screen then only the table control is to be displayed .
Let me know if this is clear.
thanks,
mohan -
Listbox displaying dynamic values in table control
Hi Experts,
The requirement that I have is that there are two columns in an internal table out of which second one is a listbox.
There is a need of displaying dynamic values in a row in a listbox according to value entered in first column of the same row, not affecting the listbox values in other rows.
I am using VRM_SET_VALUES for populating listbox, but it results in populating the listbox in all other rows also.
Please help.
Thanks,
GarimaHi Thanks for the link..
But my problem is something else.
I want the same listbox of a column in a table control to show me different values in different rows on the basis of value in another column .
Regards,
Garima -
Hi Experts,
My Requirement is create a table control with 5 coloumns. The rows have to be displayed dynamically...
I created a screen , and placed a table control.
For eg :
if my internal table having 2 entries , then the table control should only have two rows....(no disable/greyout)
if internal table having say 40 entries , then the table control should have 40 rows...
Thanks,
Lakshmiraj.AHi,
Refer
table control dynamic rows
Dynamic rows increment according to user input in Table Control Module Pool
Hope this helps
Sumana -
Adding dynamic columns in Table Control
Hi All,
Can we add dynamic columns in a table control? The requirement is something like this. When the user clicks a button it should add a column to the table. Also is it possible for the same column to refer to different fields of the Internal Table of the Database table. Example. The first row in the table control must refer to MARA-MATNR and the second row must refer to MAKT-MAKTX.
Regards,
SudhindraHello Sudhindra,
If you know all the columns that the table control will ever contain, then I suppose it is possible to add and delete the columns dynamically.
What cannot be dynamic, is the determination of which coulmn would be displayed in the table control.
To elaborate, In SE51, you have to define the table control with all the possible columns. In the program, during the PBO, you can choose to hide some of these columns. When the user performs certain action (PAI), you can determine which opf the hidden columns would be displayed in the table control after the next PBO.
Coming to your second requirement, I don't think it is directly possible in case of table conrols. You will have to do some manipulation to achieve it. But even if you can I think you should not. Because, It is not elegant from a good-UI design perspective. ANd during the course of the necessary manipulations, we might have to forgo some of the features like Automatic Field Validation, Automatic Input Help etc. You can use ALV for the same.
Please be judicious in deciding which approach to consider and if you run into some more problems, please do get back with some more details like how many columns you have, how many different row-types do you want, what are the features for the fields that you wish to provide (eg. F4 help) an so on...
Regards,
Anand Mandalika. -
Dynamic Coloumn in Table Control
Hi,
I have a requirement to create coloumns in table control at runtime.
For e.g. if we see transaction SM34.
click on one box displays one set of coloumns on right side and so on.
one way is, i take all the coloums that can be displayed (may be later) and hide them according to the click on the tree.
But i am not sure whether it is the right approach.
using ALV will be my last approach.
kindly guide me to resolve this.
thanks
gauravHi,
If you know maximum no of columns you have to display dynamically. You can put all the columns in the internal table and generate a table control. Then make it invisible. Enable it on the click event. Also you can name the columns in such a way that the ucomms and the internal table column name matches. Say like COl1 col 2 and so on. you can use Assign component structure to aid making it visible.
Good luck!!!
Cordially,
Shankar Narayanan. -
How to get the Number of lines displayed in table control in bdc
Hi,
when we write a bdc for a standard transaction, if we encounter a table control, we fill the values for each record like field(01), and the second record field(02) .......and so on..
if only 3 records are displayed in the screen and if we have 5 records to be filled in the table control, how to write the logic for that?
how to track of how many lines are getting displayed in the table control .. again it depends on the screen resolution i think..
useful answers will be rewarded
shekharHi,
Here is the solution code for this :-
data for controlling paging on screen 0102
DATA: W_MAXLINES(2) TYPE N,
W_NEXT_LINE(3) TYPE N,
W_PAGE(1), "y = page forward, n otherwise
W_SCRLEN(2) TYPE I,
W_SCRLINE(2) TYPE I.
DATA: BEGIN OF W_HDR.
INCLUDE STRUCTURE D020S.
DATA: END OF W_HDR.
DATA: BEGIN OF W_FLD OCCURS 100.
INCLUDE STRUCTURE D021S.
DATA: END OF W_FLD.
DATA: BEGIN OF W_LOG OCCURS 20.
INCLUDE STRUCTURE D022S.
DATA: END OF W_LOG.
DATA: BEGIN OF W_MC OCCURS 20.
INCLUDE STRUCTURE D023S.
DATA: END OF W_MC.
DATA: BEGIN OF W_DYNPRONAME,
PROGRAM(8) VALUE 'SAPMM60X',
DYNPRO(4) VALUE '0102',
END OF W_DYNPRONAME.
FORM GET_MAX_LINES.
set w_maxlines to the number of var-loop occurrences on the screen so
that we know when to page forward on screen 0102
also initialise w_next_line to zero for GET_NEXT_LINE
this subroutine caters for all cases - including screens without loops
CLEAR: W_MAXLINES,
W_NEXT_LINE.
IMPORT DYNPRO W_HDR
W_FLD
W_LOG
W_MC
ID W_DYNPRONAME.
LOOP AT W_FLD WHERE LTYP EQ 'L'.
MOVE W_FLD-LINE TO W_SCRLINE. "first var-loop line
MOVE W_FLD-LBLK TO W_SCRLEN. "depth of loop block
EXIT.
ENDLOOP.
IF SY-SUBRC EQ 0
AND W_SCRLEN NE 0.
sy-srows = total no of lines on screen
w_scrline = actual first line of loop so that
w_scrline - 1 = number of heading lines (before loop)
4 = no of lines at top of screen - command line, pushbuttons, 2 ulines
3 = no of lines after loop - uline & Page count
w_scrlen = no of lines in loop block
w_maxlines = sy-srows - ( wscrline - 1 ) - 4 - 3
and then 1 less but not sure why!
W_MAXLINES = SY-SROWS - W_SCRLINE - 1 - 4 - 3.
W_MAXLINES = W_MAXLINES - 1.
W_MAXLINES = W_MAXLINES DIV W_SCRLEN.
ELSE.
MOVE 99 TO W_MAXLINES. "this required if no screen loop
ENDIF.
ENDFORM.
FORM GET_NEXT_LINE.
set w_page if page forward is required
W_NEXT_LINE = W_NEXT_LINE + 1.
IF W_NEXT_LINE GT W_MAXLINES.
W_NEXT_LINE = 1.
W_PAGE = 'Y'.
ELSE.
W_PAGE = 'N'.
ENDIF.
ENDFORM.
Hope it helps.
reward if helpful.
Regards,
Sipra -
Error when displaying - on table control
hy guys,
im working with a table control..
the problem is when the table control loads a -200 or any number with - .
ERROR
DYNPRO_FIELD_CONVERSION
I already tried to change the format of the table field to currency, dec, char and numc
currency the error is displayed.
dec the error is displayed
char the column is displayed empty
numc the table is displayed but the - is not displayed in the field.
any ideas?
Edited by: javier santana on Sep 7, 2008 7:26 PMHi,
The problem mayb with the -ve value display, keep the format to currency and double click on the field in table control, u wil find a option to display -ve values select that
If -ve value is ur prob then this should work -
Dynamic tabstrips and table control in custom infotype
Dear Experts,
I have a requirement to create a custom infotype using tabstrips and table control. The tabstripes should also be dynamically populated. For example we have infty 8(Basic pay) used table control and 24(Qualifications) for tabstripes.
Could you please tell me how to do this. Please do the needful ASAP.
Thanks,
Chaitanya.
Moderator message - Please don't just post your requirements and ask the forum to do your work for you...especially ASAP - Thread locked
Edited by: Rob Burbank on Oct 7, 2009 4:16 PMHi Partha,
Pls check the threads:
Best way to store a table control into an infotype
Re: Custom Infotype with table control - Overview/List Screen
Dilek -
Hi friends,
I am having a problem when sorting the table control dynamically based on the fields selectd.
sorting is not working, when you select multiple fields ( one numeric field and one character field ) I have written code for handling multiple field sort,gettting field names correctly, everything looks fine but internal table is not getting sorted.
Is it related unicode issue..?
Any help will be appreciated.
Sample code:
loop at tc_control into lc_cols.
case lc_cols-selected.
wehn 'X'.
split lc_cols-screen-name at '-' into gv_tabname gv_fieldname.
move gv_fieldname gs_struc+lv_off(20)
add 20 to lv_off.
endcase.
endloop.
if ok_code = 'ASCE'.
sort itab by (gs_struc-field1) (gs_struc-field2) ..... ascending
endif.
Thanks in advance
Thiru.pHi
Try using an internal table for the field names..
Example
DATA: BEGIN OF ITAB OCCURS 0,
MATNR TYPE MATNR,
WERKS TYPE WERKS_D,
END OF ITAB.
DATA: ITAB_FIELD(30) OCCURS 0 WITH HEADER LINE.
DATA
ITAB-MATNR = 'ABC'.
ITAB-WERKS = 'ABCD'.
APPEND ITAB.
ITAB-MATNR = 'ABC'.
ITAB-WERKS = 'ABC'.
APPEND ITAB.
SORT INTERNAL TABLE
ITAB_FIELD = 'MATNR'.
<b>APPEND ITAB_FIELD.</b>
ITAB_FIELD = 'WERKS'.
<b>APPEND ITAB_FIELD.</b>
<b>SORT ITAB BY (ITAB_FIELD).</b>
LOOP AT ITAB.
WRITE: / ITAB-MATNR,ITAB-WERKS.
ENDLOOP.
Thanks
Naren -
Dynamic Screen in Table Control
Hello Guys,
I have a problem on screen dynpro. In the screen, i have a table control and i set all the field can be input.
But i have 2 t-code where 1 of the t-code can edited the data and another one only display.
So in screen status, i insert this code.
IF sy-tcode = 'ZDLKWPP3'.
LOOP AT SCREEN.
IF screen-group1 = 'ZKP'.
screen-input = 0.
screen-output = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
but when i execute, the screen still can be input. can anyone help me please...!!!!That coding i put it in "MODULE STATUS 0300." Those are the coding for the screen and the module status.
*************--code for the screen----******************
PROCESS BEFORE OUTPUT.
MODULE STATUS_0300.
*&spwizard: pbo flow logic for tablecontrol 'TBL_KWPP'
module TBL_KWPP_init.
*&spwizard: module TBL_KWPP_change_tc_attr.
*&spwizard: module TBL_KWPP_change_col_attr.
module TBL_KWPP_change_tc_attr.
loop at g_TBL_KWPP_itab
into g_TBL_KWPP_wa
with control TBL_KWPP
cursor TBL_KWPP-current_line.
*&spwizard: module TBL_KWPP_change_field_attr
module TBL_KWPP_move.
module TBL_KWPP_get_lines.
endloop.
module cal_sum2.
PROCESS AFTER INPUT.
MODULE returnexit AT EXIT-COMMAND.
*&spwizard: pai flow logic for tablecontrol 'TBL_KWPP'
loop at g_TBL_KWPP_itab.
chain.
field ZLMDL015A-ZRUMJEN.
field ZLMDL015A-ZRUMFAED.
field ZLMDL015A-ZRUMULA.
field ZLMDL015A-ZRUMAKH.
field ZLMDL015A-ZRUMAMB.
field ZLMDL015A-ZRUMTERIMA.
field ZLMDL015A-ZRUMBAYARAN.
field ZLMDL015A-ZRUMAMNOM.
field G_TBL_KWPP_WA-FLAG
MODULE tab_vot_mark1 ON REQUEST.
MODULE TBL_KWPP_modify ON CHAIN-REQUEST.
endchain.
endloop.
module TBL_KWPP_user_command.
*&spwizard: module TBL_KWPP_change_tc_attr.
*&spwizard: module TBL_KWPP_change_col_attr.
MODULE USER_COMMAND_0300.
*******---code for the module status---**********
MODULE STATUS_0300 OUTPUT.
SET PF-STATUS '0300'.
* SET TITLEBAR 'TITLE3' WITH 'Wujud/Kemaskini'.
* zlmfl030-zlmtkhlaras = w_ztksej.
perform set_tarikh.
* perform find_data.
IF sy-tcode = 'ZDLKWPP1'.
SET TITLEBAR 'TITLE' WITH 'Wujud/Kemaskini'.
SET PF-STATUS '0300'.
ELSE.
SET TITLEBAR 'TITLE' WITH 'Papar'.
SET PF-STATUS '0300' EXCLUDING 'SAVE'.
endif.
IF sy-tcode = 'ZDLKWPP3'.
LOOP AT SCREEN.
IF screen-group1 CS 'ZKP'.
screen-input = 0.
screen-output = 1.
MODIFY SCREEN.
CLEAR SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " STATUS_0300 OUTPUT
and as you can see i try ashavind code, it still not working. -
Dynamic headings in table Control
Hey everybody,
I have a table control in which I need to fill the headings of the columns dynamically at runtime.
Is that possible? If yes, how?
Thanks for your suggestions, Kathrin!Hi Rob,
I appreciate your help.
Anybody other suggestions?
Screen painter won't let me change the text-fields in the column headings to I/O fields.
I get an error message 37 219 telling me switching from textfield to i/o field is not possible.
If I delete the text field, I can not create a I/O field in heading of the column.
Next, I tried changing the text-fields to 'input allowed' in the attributes, but it does not work.
If I write a "field" statement to ensure data transport for the text-fields in PBO of the dynpro, I get a syntax error.
Can anybody give me a hint?
Thanks and kind regards, Kathrin!
Maybe you are looking for
-
Can a 5.1 PC speaker system be hooked up to a 2009 iMac computer?
Can an older 5.1 Suround sound speaker system from a Windows XP based computer be hooked up and operate through a 2009/2010 Intel based iMac computer?
-
How to change style property in runtime
Hallo. I have this style tag in my main application: <fx:Style> @namespace s "library://ns.adobe.com/flex/spark"; @namespace mx "library://ns.adobe.com/flex/halo"; @font-face { src: url("../caratteri/MyriadPro-Bold.otf"); fon
-
Tell me about pop up window in abap
hi all, i want to do a pop up message . when material stock is below the lower limit. it give the automatic message to user to take the action . pls tell me how i can do this in abap. regards vikas .
-
Human Task form deployment issue
Dear Experts, How to deploy Human Task form WAR file to the BPEL OC4J container through SOA em console. I have viewed through em console but i cant see any option for (war or ear ) work flow deployment. Please suggest. Thanks Rajesh A
-
Intergrate Apex with R12 , How to Extend Oracle EBS with Oracle Apex
Question out to the experts. I am looking for the easiet way to launch an Apex Application from EBS, we are currently on 12.1.3 (EBS) and 3.2 (Apex, we will be updgrading here shortly). We would like to create a responsibilty in EBS , when click upon