WIZARD FOR TABLE CONTROL DOCUMENTS REQUIRED
hI ALL,
cAN ANYBODY SEND ME DOCUMENTS RELATED TO TABLE CONTROL USING WIZARD.i NEED TO CREATE A TABLE IN WHICH I WOULD FILL THE TABLE WITH AND WHEN I SAVE IT I NEED THE ZTABLE TO BE UPDATED .
cAN ANYBODY SEND ME SOME DOCUMENTS REGARDING HOW TO USE WIZARD.
mY EMAIL ID :
[email protected]
tHANKS IN ADVANCE
Hi Kajol,
I was searching online and came with this short steps from this link:
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/dialogprogramcall-dump-725857#
(1) drag the table control (with wizard) on the full screen. (2) press continue. (3) enter the name of your table control (any name you want) (4) press continue (5) select 'internal table' (6) enter name of your internal table (the one that contains data to be displayed for table control) (7) press continue (8) fields of your itab will be displayed then, select the fields you want to be seen on your table control (9) continue pressing 'continue' until complete button is shown (10) press 'complete'.
I tried giving database table name instead of internal table at point number (6).
Also, did you go thru this link:
http://help.sap.com/saphelp_nw04/helpdata/en/6d/150d67da1011d3963800a0c94260a5/content.htm
Hope this will be of some help to you.
Regards,
Vivek
Similar Messages
-
Screen Variant for table control in FB60
Hi ,
I need to create variant to show Quantity and Base Unit of Measure columns in the table control which is available at the first screen of FB60 . I tried using the option screen variant - > create variant. i couldnt see the options of colmuns properties for table control on click that small icon available at the right conner. Pls guide.
ThanksIn transaction SHD0 you need to create a new variant.
After that you will be taken into FB60.
Press Enter as if you are trying to process vendor invoice. It will take you to a screen "Screen values 1100 Program SAPMF05A"
There you will have 3 columns Output only, Invisible and Mandatory.
Select as you want.
Just try out carefully, you will be able to get the desired result.
It is very difficult to guide you in details.
Please let me know if you face any problems.
Rgds,
Harmees -
BDC Recording for Table Control
dears,
I am using BDC for posting payments by TCode FP05.
after processing two payment items i am getting the following error.
"Runtime error SAPSQL_ARRAY_INSERT_DUPREC has occurred"
but when i repeat the same recording in foreground it processes the payment sucessfully.
wht could be wrong with the recording?
how to record for table control?
ByeHi Syed,
I could find few notes for the array insert duplicate runtime error.
136433
191544
You can find may in OSS.
Cheers
Vinod -
IB51, IB52 : Page up & Page Down option for table control disabled
Hi experts,
IB51, IB52 Page up & Page Down option for table control is disabled.
We want to use these options in the table control while recording .
Can any one tell us?
Regards,
LakshmiHi,
You can refer to Note 379208 .
The same is applicable in CRM too.
Thanks ,
Jomy -
how to write BDC coding based on Table Controls...
http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm
How to deal with table control / step loop in BDC
Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen, our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
Now with the help of Poonam on sapfans.com developement forum, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
Demo ABAP code has two purposes:
1. how to determine number of visible lines and how to calculte page number;
(the 'calpage' routine has been modify to meet general purpose usage)
2. using field symbol in BDC program, please pay special attention to the difference in Static ASSIGN and Dynamic ASSIGN.
Now I begin to describe the step to implement my method:
(I use transaction 'ME21', screen 121 for sample,
the method using is Call Transation Using..)
Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop. Then have a look at steploop itselp, one entry of it will occupy two lines.
(Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
Now we have : FixedLine = 9
LoopLine = 2(for table control, LoopLine is always equal to 1)
Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
Now we have: FirstLine = 0
or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
Step3: write a subroutine calcalculating number of pages
(here, the name of actual parameter is the same as formal parameter)
global data: FixedLine type i, " number of fixed line on a certain screen
LoopLine type i, " the number of lines occupied by one steploop item
FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new " scrolling screen is empty, otherwise is 1
Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
pageno type i, " you need to scroll screen how many times.
line type i, " number of lines appears on the screen.
index(2) type N, " the screen index for certain item
begin type i, " from parameter of loop
end type i. " to parameter of loop
*in code sample, the DataTable-linindex stands for the table index number of this line
form calpage using FixedLine type i (see step 1)
LoopLine type i (see step 1)
FirstLine type i (see step 2)
DataLine type i ( this is the item number you will enter in transaction)
changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
changing line type i.(visible lines one the screen)
data: midd type i,
vline type i, "visible lines
if DataLine eq 0.
Message eXXX.
endif.
vline = ( sy-srows - FixedLine ) div LoopLine.
*for table control, you should compare vline with maximum line of
*table control, then take the small one that is min(vline, maximum)
*here only illustrate step loop
if FirstLine eq 0.
pageno = DataLine div vline.
if pageno eq 0.
pageno = pageno + 1.
endif.
elseif FirstLine eq 1.
pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
midd = ( DataLine - 1 ) mod ( vline - 1).
if midd = 0 and DataLine gt 1.
pageno = pageno - 1.
endif.
endif.
line = vline.
endform.
Step4 write a subroutine to calculate the line index for each item.
form calindex using Line type i (visible lines on the screen)
FirstLine type i(see step 2)
LineIndex type i(item index)
changing Index type n. (index on the screen)
if FirstLine = 0.
index = LineIndex mod Line.
if index = '00'.
index = Line.
endif.
elseif FirstLine = 1.
index = LineIndex mod ( Line - 1 ).
if ( index between 1 and 0 ) and LineIndex gt 1.
index = index + Line - 1.
endif.
if Line = 2.
index = index + Line - 1.
endif.
endif.
endform.
Step5 write a subroutine to calculate the loop range.
form calrange using Line type i ( visible lines on the screen)
DataLine type i
FirstLine type i
loopindex like sy-index
changing begin type i
end type i.
If FirstLine = 0.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loopindex gt 1.
begin = Line * ( loopindex - 1 ) + 1.
end = Line * loopindex.
if end gt DataLine.
end = DataLine.
endif.
endif.
elseif FirstLine = 1.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loop index gt 1.
begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
if end gt DataLine.
end = DataLine.
endif.
endif.
endif.
endform.
Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index in steploop/Table Control
form creat_bdc.
field-symbols: <material>, <quan>, <indicator>.
data: name1(14) value 'EKPO-EMATN(XX)',
name2(14) value 'EKPO-MENGE(XX)',
name3(15) value 'RM06E-SELKZ(XX)'.
assign: name1 to <material>,
name2 to <quan>,
name3 to <indicator>.
do pageno times.
if sy-index gt 1
*insert scroll page ok_code"
endif.
perform calrange using Line DataLine FirstLine sy-index
changing begin end.
loop at DataTable from begin to end.
perform calindex using Line FirstLine DataTable-LineIndex changing Index.
name1+11(2) = Index.
name2+11(2) = Index.
name3+12(2) = Index.
perform bdcfield using <material> DataTable-matnr.
perform bdcfield using <quan> DataTable-menge.
perform bdcfield using <indicator> DataTable-indicator.
endloop.
enddo.
Cheers
VJ -
Unable get the table scroll for table control
hai
i unable get horizontal scrolling for table control when the output is dislayed
help me
very urgentHi,
check out the sample program it might help you
See the following simple ex
*& Module pool ZTEST_TBLCTRL
PROGRAM ZTEST_TBLCTRL.
***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TC1'
*&SPWIZARD: DEFINITION OF DDIC-TABLE
TABLES: ZFG_SRNO, ZFIH0004.
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TC1'
*TYPES: BEGIN OF T_TC1,
ZSRNO LIKE ZFG_SRNO-ZSRNO,
SCRNAME LIKE ZFIH0004-SCRNAME,
END OF T_TC1.
*TYPES: BEGIN OF T_TC1.
STRUCTURE ZFG_SRNO.
END OF T_TC1.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TC1'
*DATA: G_TC1_ITAB TYPE T_TC1 OCCURS 0 WITH HEADER LINE,
G_TC1_WA TYPE T_TC1. "work area
DATA: G_TC1_ITAB LIKE ZFG_SRNO OCCURS 0 WITH HEADER LINE,
G_TC1_WA LIKE G_TC1_ITAB. "work area
DATA: G_TC1_COPIED. "copy flag
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TC1' ITSELF
CONTROLS: TC1 TYPE TABLEVIEW USING SCREEN 0100.
*&SPWIZARD: LINES OF TABLECONTROL 'TC1'
DATA: G_TC1_LINES LIKE SY-LOOPC.
DATA: OK_CODE LIKE SY-UCOMM,
S_CODE LIKE SY-UCOMM,
MARK.
DATA: T1(10).
*&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TC1_INIT OUTPUT.
IF G_TC1_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZFG_SRNO'
*&SPWIZARD: INTO INTERNAL TABLE 'g_TC1_itab'
SELECT * FROM ZFG_SRNO
INTO CORRESPONDING FIELDS
OF TABLE G_TC1_ITAB.
G_TC1_COPIED = 'X'.
REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
IF T1 <> SPACE.
G_TC1_ITAB-ZSRNO = T1.
CLEAR T1.
APPEND G_TC1_ITAB.
REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
ENDIF.
*TC1-TOP_LINE = 1.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TC1_MOVE OUTPUT.
MOVE-CORRESPONDING G_TC1_WA TO ZFG_SRNO.
if sy-subrc ne 0.
*append G_TC1_WA to G_TC1_ITAB.
*endif.
READ TABLE G_TC1_ITAB INDEX TC1-CURRENT_LINE.
IF SY-SUBRC = 0.
G_TC1_WA-ZSRNO = G_TC1_ITAB-ZSRNO.
ENDIF.
MOVE-CORRESPONDING G_TC1_ITAB TO ZFG_SRNO.
REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
*******Below line is the logic for scrolling.
tc1-lines = G_TC1_LINES + 100.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GET LINES OF TABLECONTROL
MODULE TC1_GET_LINES OUTPUT.
G_TC1_LINES = SY-LOOPC.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TC1_MODIFY INPUT.
*break-point.
MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_ITAB.
MODIFY G_TC1_ITAB INDEX TC1-CURRENT_LINE.
G_TC1_COPIED = 'X'.
REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_WA.
MODIFY G_TC1_ITAB
FROM G_TC1_WA
INDEX TC1-CURRENT_LINE.
G_TC1_COPIED = 'X'.
if sy-subrc ne 0.
append G_TC1_WA to G_TC1_ITAB.
endif.
*modify G_TC1_ITAB INDEX TC1-CURRENT_LINE.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: PROCESS USER COMMAND
MODULE TC1_USER_COMMAND INPUT.
OK_CODE = SY-UCOMM.
PERFORM USER_OK_TC USING 'TC1'
'G_TC1_ITAB'
'FLAG'
CHANGING OK_CODE.
SY-UCOMM = OK_CODE.
ENDMODULE.
INCLUDE TABLECONTROL_FORMS *
*& Form USER_OK_TC *
FORM USER_OK_TC USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME
CHANGING P_OK LIKE SY-UCOMM.
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA: L_OK TYPE SY-UCOMM,
L_OFFSET TYPE I.
&SPWIZARD: END OF LOCAL DATA----
*&SPWIZARD: Table control specific operations *
*&SPWIZARD: evaluate TC name and operations *
SEARCH P_OK FOR P_TC_NAME.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
L_OFFSET = STRLEN( P_TC_NAME ) + 1.
L_OK = P_OK+L_OFFSET.
*&SPWIZARD: execute general and TC specific operations *
CASE L_OK.
WHEN 'INSR'. "insert row
PERFORM FCODE_INSERT_ROW USING P_TC_NAME
P_TABLE_NAME.
CLEAR P_OK.
WHEN 'DELE'. "delete row
PERFORM FCODE_DELETE_ROW USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
CLEAR P_OK.
WHEN 'P--' OR "top of list
'P-' OR "previous page
'P+' OR "next page
'P++'. "bottom of list
PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
L_OK.
CLEAR P_OK.
WHEN 'L--'. "total left
PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
WHEN 'L-'. "column left
PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
WHEN 'R+'. "column right
PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
WHEN 'R++'. "total right
PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
WHEN 'MARK'. "mark all filled lines
PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'DMRK'. "demark all filled lines
PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'SASCEND' OR
'SDESCEND'. "sort column
PERFORM FCODE_SORT_TC USING P_TC_NAME
l_ok.
ENDCASE.
ENDFORM. " USER_OK_TC
*& Form FCODE_INSERT_ROW *
FORM fcode_insert_row
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_LINES_NAME LIKE FELD-NAME.
DATA L_SELLINE LIKE SY-STEPL.
DATA L_LASTLINE TYPE I.
DATA L_LINE TYPE I.
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <LINES> TYPE I.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
ASSIGN (L_LINES_NAME) TO <LINES>.
*&SPWIZARD: get current line *
GET CURSOR LINE L_SELLINE.
IF SY-SUBRC <> 0. " append line to table
L_SELLINE = <TC>-LINES + 1.
*&SPWIZARD: set top line *
IF L_SELLINE > <LINES>.
<TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
ELSE.
<TC>-TOP_LINE = 1.
ENDIF.
ELSE. " insert line into table
L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
ENDIF.
*&SPWIZARD: set new cursor line *
L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
*&SPWIZARD: insert initial line *
INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
<TC>-LINES = <TC>-LINES + 1.
*&SPWIZARD: set cursor *
SET CURSOR LINE L_LINE.
ENDFORM. " FCODE_INSERT_ROW
*& Form FCODE_DELETE_ROW *
FORM fcode_delete_row
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: delete marked lines *
DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
IF <MARK_FIELD> = 'X'.
DELETE <TABLE> INDEX SYST-TABIX.
IF SY-SUBRC = 0.
<TC>-LINES = <TC>-LINES - 1.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " FCODE_DELETE_ROW
*& Form COMPUTE_SCROLLING_IN_TC
text
-->P_TC_NAME name of tablecontrol
-->P_OK ok code
FORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
P_OK.
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TC_NEW_TOP_LINE TYPE I.
DATA L_TC_NAME LIKE FELD-NAME.
DATA L_TC_LINES_NAME LIKE FELD-NAME.
DATA L_TC_FIELD_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <LINES> TYPE I.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
ASSIGN (L_TC_LINES_NAME) TO <LINES>.
*&SPWIZARD: is no line filled? *
IF <TC>-LINES = 0.
*&SPWIZARD: yes, ... *
L_TC_NEW_TOP_LINE = 1.
ELSE.
*&SPWIZARD: no, ... *
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
ENTRY_ACT = <TC>-TOP_LINE
ENTRY_FROM = 1
ENTRY_TO = <TC>-LINES
LAST_PAGE_FULL = 'X'
LOOPS = <LINES>
OK_CODE = P_OK
OVERLAPPING = 'X'
IMPORTING
ENTRY_NEW = L_TC_NEW_TOP_LINE
EXCEPTIONS
NO_ENTRY_OR_PAGE_ACT = 01
NO_ENTRY_TO = 02
NO_OK_CODE_OR_PAGE_GO = 03
OTHERS = 0.
ENDIF.
*&SPWIZARD: get actual tc and column *
GET CURSOR FIELD L_TC_FIELD_NAME
AREA L_TC_NAME.
IF SYST-SUBRC = 0.
IF L_TC_NAME = P_TC_NAME.
*&SPWIZARD: et actual column *
SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
ENDIF.
ENDIF.
*&SPWIZARD: set the new top line *
<TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
ENDFORM. " COMPUTE_SCROLLING_IN_TC
*& Form FCODE_TC_MARK_LINES
marks all TableControl lines
-->P_TC_NAME name of tablecontrol
FORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
&SPWIZARD: EGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: mark all filled lines *
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
<MARK_FIELD> = 'X'.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*& Form FCODE_TC_DEMARK_LINES
demarks all TableControl lines
-->P_TC_NAME name of tablecontrol
FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: demark all filled lines *
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
<MARK_FIELD> = SPACE.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*& Module D20XX_INIT OUTPUT
text
MODULE D20XX_INIT OUTPUT.
*if screen-name = 'ZSRNO'.
SCREEN-INPUT = 0.
SCREEN-COLOR = 0.
MODIFY SCREEN.
endif.
ENDMODULE. " D20XX_INIT OUTPUT
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
*CLEAR R1_REF.
DO 30 TIMES.
APPEND G_TC1_ITAB.
ENDDO.
DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module TAB1_INIT OUTPUT
text
MODULE TAB1_INIT OUTPUT.
ENDMODULE. " TAB1_INIT OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module MESSAGE INPUT
text
MODULE MESSAGE INPUT.
OK_CODE = SY-UCOMM.
S_CODE = OK_CODE.
CLEAR OK_CODE.
if S_CODE = 'DELE'.
loop at G_TC1_ITAB.
if G_TC1_ITAB-scrname = 'X'.
delete g_tc1_itab.
endif.
endloop.
ELSEIF S_CODE = 'SAVE'.
G_TC1_WA-ZSRNO = T1.
MOVE-CORRESPONDING G_TC1_WA TO ZFG_SRNO.
REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
ENDIF.
ENDMODULE. " MESSAGE INPUT
*& Module DELETE_RECORD INPUT
text
MODULE DELETE_RECORD INPUT.
IF MARK = 'X' AND S_CODE = 'DELE'.
DELETE TABLE G_TC1_ITAB FROM ZFG_SRNO.
DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
ENDIF.
ENDMODULE. " DELETE_RECORD INPUT
*********************Screen modules*********************
PROCESS BEFORE OUTPUT.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TC1'
MODULE TC1_INIT.
*&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
LOOP AT G_TC1_ITAB
INTO G_TC1_WA
WITH CONTROL TC1
CURSOR TC1-CURRENT_LINE.
*&SPWIZARD: MODULE TC1_CHANGE_FIELD_ATTR
MODULE TC1_MOVE.
MODULE TAB1_INIT.
MODULE TC1_GET_LINES.
ENDLOOP.
MODULE D20XX_INIT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC1'
*BREAK POINT.
LOOP AT G_TC1_ITAB.
CHAIN.
FIELD ZFG_SRNO-ZSRNO.
MODULE TC1_MODIFY ON CHAIN-REQUEST.
MODULE TC1_MODIFY.
ENDCHAIN.
MODULE MESSAGE .
MODULE DELETE_RECORD.
ENDLOOP.
MODULE TC1_USER_COMMAND.
*&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
MODULE USER_COMMAND_0100.
please check out the link below for more information it might help you
http://help.sap.com/saphelp_sm32/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/d1/801c7b454211d189710000e8322d00/content.htm
http://www.sapbrainsonline.com/REFERENCES/ABAP_SYNTAX/SAP_ABAP_SYNTAX.html
*********please reward points if the information is helpful to you************* -
An itab has been used as source for table control
Hi,
An itab has been used as source for table control without delete option of table control.
Now I need to delete the row which the mouse arrow is on.
Can I do this?
Thanks.Hi Deniz,
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'DEL'.
remove marked lines
LOOP AT it_tabctrl
INTO wa_tabctrl
WHERE marked EQ kc_sel.
IF sy-subrc EQ 0.
DELETE it_tabctrl INDEX sy-tabix.
ENDIF.
ENDLOOP.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT -
Function module for table control
Hi experts,
I am creating the BDC program, In that I need to select the particular item from the table control say for example item 0010 or 0020 based on the input file and need to process from there.
Is there any function module to select the particular item by passing item no say 0010 or 0020.
Thanks in advance
saiHi
I suppose there is no function module for table control.
below solution might be useful to you.
1) Do BDC recording for the table control with each condition you would like to incorporate in your program.
2) copy the code of Table Control recording in your program and place the code in Loop of internal table.
3) based on the condition call the respective BDC recording of the table control
4) By the above steps you can manage the table control based on the condition.
Regards
Santosh Kumaar.M -
Table type not defined for table control "T_CONTROL" (Custom table)
Hi All,
I m facing a problem in ITS mobile service.
The Table control designed by me in R/3 (Module pool program) is
not getting displayed in ITS mobile page.
It is giving me an error "Table type not defined for table control "T_CONTROL" (Custom table) ".
Can you please let me how this issue can be resolved.
With Regards,
MaheshCONTROLS: table_ctr TYPE TABLEVIEW USING SCREEN '0010'.
try using this....
Regards
Vasu -
'how to code for table control wizard in module pool program
Hi Gurus,
Please provide me a sample code of table control wizard...
Thanks in advance!!!!
Regards,
KranthiHi Kranti,
check this code... it should be helpful
*& Module pool Z_TABLE_CONTROL_WIZARD_DEMO *
PROGRAM z_table_control_wizard_demo .
DATA: BEGIN OF lt_vbak OCCURS 0,
flag TYPE c,
vbeln TYPE vbeln_va,
netwr TYPE netwr,
kunnr TYPE kunnr,
END OF lt_vbak.
DATA: sfkunnr TYPE kunnr.
*&spwizard: declaration of tablecontrol 'TCONTROL' itself
CONTROLS: tcontrol TYPE TABLEVIEW USING SCREEN 9000.
*&spwizard: lines of tablecontrol 'TCONTROL'
DATA: g_tcontrol_lines LIKE sy-loopc.
DATA: ok_code LIKE sy-ucomm.
*&spwizard: output module for tc 'TCONTROL'. do not change this line!
*&spwizard: update lines for equivalent scrollbar
MODULE tcontrol_change_tc_attr OUTPUT.
DESCRIBE TABLE lt_vbak LINES tcontrol-lines.
ENDMODULE. "TCONTROL_change_tc_attr OUTPUT
*&spwizard: output module for tc 'TCONTROL'. do not change this line!
*&spwizard: get lines of tablecontrol
MODULE tcontrol_get_lines OUTPUT.
g_tcontrol_lines = sy-loopc.
ENDMODULE. "TCONTROL_get_lines OUTPUT
*&spwizard: input module for tc 'TCONTROL'. do not change this line!
*&spwizard: modify table
MODULE tcontrol_modify INPUT.
MODIFY lt_vbak
INDEX tcontrol-current_line.
ENDMODULE. "TCONTROL_modify INPUT
*&spwizard: input modul for tc 'TCONTROL'. do not change this line!
*&spwizard: mark table
MODULE tcontrol_mark INPUT.
DATA: g_tcontrol_wa2 LIKE LINE OF lt_vbak.
IF tcontrol-line_sel_mode = 1.
LOOP AT lt_vbak INTO g_tcontrol_wa2
WHERE flag = 'X'.
g_tcontrol_wa2-flag = ''.
MODIFY lt_vbak
FROM g_tcontrol_wa2
TRANSPORTING flag.
ENDLOOP.
ENDIF.
MODIFY lt_vbak
INDEX tcontrol-current_line
TRANSPORTING flag.
ENDMODULE. "TCONTROL_mark INPUT
*&spwizard: input module for tc 'TCONTROL'. do not change this line!
*&spwizard: process user command
MODULE tcontrol_user_command INPUT.
ok_code = sy-ucomm.
PERFORM user_ok_tc USING 'TCONTROL'
'LT_VBAK'
'FLAG'
CHANGING ok_code.
sy-ucomm = ok_code.
ENDMODULE. "TCONTROL_user_command INPUT
* INCLUDE TABLECONTROL_FORMS *
*& Form USER_OK_TC *
FORM user_ok_tc USING p_tc_name TYPE dynfnam
p_table_name
p_mark_name
CHANGING p_ok LIKE sy-ucomm.
*&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
DATA: l_ok TYPE sy-ucomm,
l_offset TYPE i.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
*&SPWIZARD: Table control specific operations *
*&SPWIZARD: evaluate TC name and operations *
SEARCH p_ok FOR p_tc_name.
IF sy-subrc <> 0.
EXIT.
ENDIF.
l_offset = STRLEN( p_tc_name ) + 1.
l_ok = p_ok+l_offset.
*&SPWIZARD: execute general and TC specific operations *
CASE l_ok.
WHEN 'INSR'. "insert row
PERFORM fcode_insert_row USING p_tc_name
p_table_name.
CLEAR p_ok.
WHEN 'DELE'. "delete row
PERFORM fcode_delete_row USING p_tc_name
p_table_name
p_mark_name.
CLEAR p_ok.
WHEN 'P--' OR "top of list
'P-' OR "previous page
'P+' OR "next page
'P++'. "bottom of list
PERFORM compute_scrolling_in_tc USING p_tc_name
l_ok.
CLEAR p_ok.
* WHEN 'L--'. "total left
* PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
* WHEN 'L-'. "column left
* PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
* WHEN 'R+'. "column right
* PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
* WHEN 'R++'. "total right
* PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
WHEN 'MARK'. "mark all filled lines
PERFORM fcode_tc_mark_lines USING p_tc_name
p_table_name
p_mark_name .
CLEAR p_ok.
WHEN 'DMRK'. "demark all filled lines
PERFORM fcode_tc_demark_lines USING p_tc_name
p_table_name
p_mark_name .
CLEAR p_ok.
* WHEN 'SASCEND' OR
* 'SDESCEND'. "sort column
* PERFORM FCODE_SORT_TC USING P_TC_NAME
* l_ok.
ENDCASE.
ENDFORM. " USER_OK_TC
*& Form FCODE_INSERT_ROW *
FORM fcode_insert_row
USING p_tc_name TYPE dynfnam
p_table_name .
*&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
DATA l_lines_name LIKE feld-name.
DATA l_selline LIKE sy-stepl.
DATA l_lastline TYPE i.
DATA l_line TYPE i.
DATA l_table_name LIKE feld-name.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <lines> TYPE i.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' p_tc_name '_LINES' INTO l_lines_name.
ASSIGN (l_lines_name) TO <lines>.
*&SPWIZARD: get current line *
GET CURSOR LINE l_selline.
IF sy-subrc <> 0. " append line to table
l_selline = <tc>-lines + 1.
*&SPWIZARD: set top line *
IF l_selline > <lines>.
<tc>-top_line = l_selline - <lines> + 1 .
ELSE.
<tc>-top_line = 1.
ENDIF.
ELSE. " insert line into table
l_selline = <tc>-top_line + l_selline - 1.
l_lastline = <tc>-top_line + <lines> - 1.
ENDIF.
*&SPWIZARD: set new cursor line *
l_line = l_selline - <tc>-top_line + 1.
*&SPWIZARD: insert initial line *
INSERT INITIAL LINE INTO <table> INDEX l_selline.
<tc>-lines = <tc>-lines + 1.
*&SPWIZARD: set cursor *
SET CURSOR LINE l_line.
ENDFORM. " FCODE_INSERT_ROW
*& Form FCODE_DELETE_ROW *
FORM fcode_delete_row
USING p_tc_name TYPE dynfnam
p_table_name
p_mark_name .
*&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
DATA l_table_name LIKE feld-name.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
*&SPWIZARD: delete marked lines *
DESCRIBE TABLE <table> LINES <tc>-lines.
LOOP AT <table> ASSIGNING <wa>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
IF <mark_field> = 'X'.
DELETE <table> INDEX syst-tabix.
IF sy-subrc = 0.
<tc>-lines = <tc>-lines - 1.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " FCODE_DELETE_ROW
*& Form COMPUTE_SCROLLING_IN_TC
* text
* -->P_TC_NAME name of tablecontrol
* -->P_OK ok code
FORM compute_scrolling_in_tc USING p_tc_name
p_ok.
*&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
DATA l_tc_new_top_line TYPE i.
DATA l_tc_name LIKE feld-name.
DATA l_tc_lines_name LIKE feld-name.
DATA l_tc_field_name LIKE feld-name.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <lines> TYPE i.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' p_tc_name '_LINES' INTO l_tc_lines_name.
ASSIGN (l_tc_lines_name) TO <lines>.
*&SPWIZARD: is no line filled? *
IF <tc>-lines = 0.
*&SPWIZARD: yes, ... *
l_tc_new_top_line = 1.
ELSE.
*&SPWIZARD: no, ... *
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
entry_act = <tc>-top_line
entry_from = 1
entry_to = <tc>-lines
last_page_full = 'X'
loops = <lines>
ok_code = p_ok
overlapping = 'X'
IMPORTING
entry_new = l_tc_new_top_line
EXCEPTIONS
* NO_ENTRY_OR_PAGE_ACT = 01
* NO_ENTRY_TO = 02
* NO_OK_CODE_OR_PAGE_GO = 03
OTHERS = 0.
ENDIF.
*&SPWIZARD: get actual tc and column *
GET CURSOR FIELD l_tc_field_name
AREA l_tc_name.
IF syst-subrc = 0.
IF l_tc_name = p_tc_name.
*&SPWIZARD: et actual column *
SET CURSOR FIELD l_tc_field_name LINE 1.
ENDIF.
ENDIF.
*&SPWIZARD: set the new top line *
<tc>-top_line = l_tc_new_top_line.
ENDFORM. " COMPUTE_SCROLLING_IN_TC
*& Form FCODE_TC_MARK_LINES
* marks all TableControl lines
* -->P_TC_NAME name of tablecontrol
FORM fcode_tc_mark_lines USING p_tc_name
p_table_name
p_mark_name.
*&SPWIZARD: EGIN OF LOCAL DATA-----------------------------------------*
DATA l_table_name LIKE feld-name.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
*&SPWIZARD: mark all filled lines *
LOOP AT <table> ASSIGNING <wa>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
<mark_field> = 'X'.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*& Form FCODE_TC_DEMARK_LINES
* demarks all TableControl lines
* -->P_TC_NAME name of tablecontrol
FORM fcode_tc_demark_lines USING p_tc_name
p_table_name
p_mark_name .
*&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
DATA l_table_name LIKE feld-name.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
*&SPWIZARD: END OF LOCAL DATA------------------------------------------*
ASSIGN (p_tc_name) TO <tc>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
*&SPWIZARD: demark all filled lines *
LOOP AT <table> ASSIGNING <wa>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
<mark_field> = space.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*& Module STATUS_9000 OUTPUT
* text
MODULE status_9000 OUTPUT.
SET PF-STATUS 'S9000'.
SET TITLEBAR 'T9000'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9000 INPUT
* text
MODULE user_command_9000 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'DISP'.
SELECT vbeln netwr kunnr INTO CORRESPONDING FIELDS OF TABLE lt_vbak
FROM vbak
WHERE kunnr = sfkunnr.
* LEAVE TO LIST-PROCESSING [AND RETURN TO SCREEN <nnnn>].
* By default, the dialog processor returns to the PBO processing of
* the screen from which the list processor was called. The optional
* addition AND RETURN TO SCREEN allows you to specify a different
* screen in the current screen sequence at whose PBO event you want
* to resume processing.
when 'LIST'.
LEAVE TO LIST-PROCESSING.
WRITE:/ 'Time :', SY-UZEIT.
LOOP AT LT_VBAK.
WRITE:/ LT_VBAK-VBELN,
LT_VBAK-NETWR,
LT_VBAK-KUNNR.
ENDLOOP.
WHEN 'SUBM'.
*& You can call executable programs from other ABAP programs using the
*& following statement:
*& SUBMIT <rep>|(<field>) [AND RETURN] [<options>].
SUBMIT z_submit_report VIA SELECTION-SCREEN AND RETURN.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
TABLE CONTROL WIZARD SE51 CODE
PROCESS BEFORE OUTPUT.
*&spwizard: pbo flow logic for tablecontrol 'TCONTROL'
module TCONTROL_change_tc_attr.
*&spwizard: module TCONTROL_change_col_attr.
loop at LT_VBAK
with control TCONTROL
cursor TCONTROL-current_line.
module TCONTROL_get_lines.
*&spwizard: module TCONTROL_change_field_attr
endloop.
MODULE STATUS_9000.
PROCESS AFTER INPUT.
*&spwizard: pai flow logic for tablecontrol 'TCONTROL'
loop at LT_VBAK.
chain.
field LT_VBAK-VBELN.
field LT_VBAK-NETWR.
field LT_VBAK-KUNNR.
module TCONTROL_modify on chain-request.
endchain.
field LT_VBAK-FLAG
module TCONTROL_mark on request.
endloop.
module TCONTROL_user_command.
*&spwizard: module TCONTROL_change_tc_attr.
*&spwizard: module TCONTROL_change_col_attr.
MODULE USER_COMMAND_9000.
regards
padma -
Bdc for table control in abap -hr
Dear all,
how can we read if infotype is having table control 0008
how to record 0008 infotype please suggest me
Regards.
bose,HI,
Have two internal table, one containing the primary data and other with multiple data regarding to particular primary data with one column as key field. In the BDC code, write LOOP Statement with the second internal table. No other modification is required for it.
Hope you understand it. -
Hi Friends,
I have an issue i am stuck here,
i have to create BDC Program for XK01 tcode,
and my requirement is that,
i have three users first user want only three colum and second user want four column
and third user want five column in table control,
so how could i achieve it,
please hekp me out.
Thanks
VikashHi Vikash,
FORM bdc_dynpro USING p_program p_dynpro.
IF user-one.
FORM bdc_field USING fnam1 fval.
FORM bdc_field USING fnam2 fval.
FORM bdc_field USING fnam3 fval.
ELSEIF user-two.
FORM bdc_field USING fnam1 fval.
FORM bdc_field USING fnam2 fval.
FORM bdc_field USING fnam3 fval.
FORM bdc_field USING fnam4 fval.
ELSEIF user-three.
FORM bdc_field USING fnam1 fval.
FORM bdc_field USING fnam2 fval.
FORM bdc_field USING fnam3 fval.
FORM bdc_field USING fnam4 fval.
FORM bdc_field USING fnam5 fval.
ENDIF.
Does this make sense?
regards,
Archer. -
How to give line items in flatfile while doing BDC for Table control
Hi all,
I am writing BDC for Multiple line items and Transaction is : FSE5N.
How do i give the data in the flat file. I mean how do we give the multiple line items in flat file , i.e for second line item again we have to header data or not ?
ex:
1015;ALL;demo;kr;INR;01;0001;3000172;100
1015;ALL;demo;kr;INR;01;0001;3000172;200
for first lineitem : 3000172;100
for 2nd line item : 3000172; 200.
header data : 1015;ALL;demo;kr;INR;01;0001.
Thanks in advance
krupaliHii ,
u can give in the same format as u have done in the example.
A B C D E F G H I
1015;ALL;demo;kr;INR;01;0001;3000172;100
1015;ALL;demo;kr;INR;01;0001;3000172;200
and while writing the loop u can give
loop at it_head.
loop at it_head where a = it_head-A and b = it_head-B ..........upto G = it_head-G.
endloop.
endloop.
check this
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Neeraj -
Problem in bdc for table control for line items
Hi experts,
I am runnig a bdc for ME52.
i am just entering PR number, in the second screen i have got all the line items. I need to select these line item 10 and double click or hit enter, it takes me to screen 3, there im just checking a checkbox and saving.
Again i need to select the line item 20 and double click or hit enter. again the same process.
Again repeat for all the line items.
But my problem is it is updating everytime for only line item 10. for line item 20 and others it say "no chnge in the data".
I am pasting my code here. please check and revert me back .plz.
DATA: w_output LIKE LINE OF i_output.
REFRESH I_ITAB[].
SELECT * FROM EBAN
INTO TABLE i_itab
WHERE banfn in s_banfn AND
bsart in s_bsart AND
bstyp in s_bstyp AND
matnr in s_matnr AND
werks in s_werks AND
lfdat in s_lfdat AND
pstyp in s_pstyp AND
knttp in s_knttp AND
estkz in s_estkz AND
loekz eq ' '.
IF sy-subrc = 0.
CLEAR: w_itab,
i_poitab[].
SORT i_itab by banfn.
LOOP AT i_itab INTO w_itab where menge GT eban-bsmng.
IF p_close = 'X' AND p_rep = 'X'.
IF w_itab-ebakz = 'X'.
w_itab-ebakz = ' '.
APPEND w_itab to i_poitab.
ENDIF.
ELSEIF p_open = 'X' AND p_rep = 'X'.
IF w_itab-ebakz = ' '.
w_itab-ebakz = 'X'.
APPEND w_itab to i_poitab.
ENDIF.
ELSEIF p_close = 'X' AND p_repw = 'X'.
IF w_itab-ebakz = ' '.
APPEND w_itab to i_poitab.
ENDIF.
ELSEIF p_open = 'X' AND p_repw = 'X'.
IF w_itab-ebakz = 'X'.
APPEND w_itab to i_poitab.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
LOOP AT i_poitab into w_output.
APPEND w_output to i_output.
PERFORM CALL_BDC.
endloop.
IF p_rep = 'X'.
PERFORM CALL_BDC.
ENDIF.
ENDFORM. " GET_DATA
*& Form CALL_BDC
text
--> p1 text
<-- p2 text
FORM CALL_BDC.
DATA: seltab(5) TYPE N,
seltab1(2) TYPE N,
tempvar(30) TYPE N,
cnt TYPE N.
LOOP AT i_output.
clear: seltab,
seltab1.
seltab = i_output-bnfpo.
seltab1 = seltab+2(2).
perform bdc_dynpro using 'SAPMM06B' '0105'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-BANFN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-BANFN'
i_output-banfn.
perform bdc_dynpro using 'SAPMM06B' '0106'.
clear tempvar.
*cnt = 1.
concatenate 'EBAN-BNFPO(' seltab1 ')' into tempvar.
perform bdc_field using 'BDC_CURSOR'
'EBAN-BNFPO(seltab1)'.
tempvar.
perform bdc_field using 'BDC_OKCODE'
'=DETA'.
perform bdc_field using 'RM06B-BNFPO'
i_output-bnfpo.
perform bdc_field using 'RM06B-TCSELFLAG(seltab1)'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-EBAKZ'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'EBAN-EBAKZ'
i_output-ebakz.
CALL TRANSACTION 'ME52' USING bdc_data MODE 'A'
MESSAGES INTO i_bdcmsg.
COMMIT WORK AND WAIT.
ENDLOOP.
ENDFORM. " CALL_BDC
*& Form bdc_dynpro
text
-->P_0686 text
-->P_0687 text
FORM bdc_dynpro USING program dynpro.
CLEAR bdc_data.
bdc_data-program = program.
bdc_data-dynpro = dynpro.
bdc_data-dynbegin = 'X'.
APPEND bdc_data.
CLEAR bdc_data.
ENDFORM.
thanks,
NLooks like table control logic is wrong -- do compare with below program...
only table contril area
REPORT ZPadmam
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.
Thanks
Seshu -
Search help for table control input value
Hi,
We have designed a GUI for supply invoice approval workflow with table control.
In the table control fields, we assigned one search help on one field.
We can enter the values(F4 Help) up 8 row in the default screen, which is having 8 row.
After scrolling down for 9th row, I am not getting any F4 help, which I am able to get upto 8 rows.
Please any one could help me in this...
BR,
ThirupathiHi,
Did you assign the search help to the <b>Search Help</b> of the <b>Attributes -> Dictionary</b> tab of the field?
Irrespective of scrolling, the F4 help should work for the field in table control.
Regards,
Raj
Maybe you are looking for
-
I interrupted a software update and my macbook pro will not boot. I have tried to reboot using the startup disc, I have tried to verify the disc, and repair the disc. It tells me I need to erase and reformat the hard drive then reinstall the operatin
-
Hi there, Aperture pre-purchase concerns and Q's According to <http://www.apple.com/aperture/specs/> it's 15- or 17-inch PowerBook G4 with a 1.25GHz or faster PowerPC G4 processor , and thus, my PB 17, 1.67, with 2GB of RAM is OK to run Aperture unde
-
Hi Experts, We changed our bank account and I need to update vendors' business partner "Payment Methods" under "Payment Run" tab. How can I deselect old bank code in "Business Partner Master Data" and select and make it default new bank code using ei
-
Scrolling only flash Scroll bar not a browser
When i scroll the scrollBar in Flash the browser is scrolling too. What i need is to stop scrolling the browser and scroll only the flash box. And the Browser have to scroll only then when the flash scrollbar is in end. Is there a solution for that?
-
SP not saving records as expected
Hi folks, I'm not sure why my SP is not saving the data as expected, instead of saving the data within the designated record set i.e. where LinkID = @LinkID, it creates a new record.... What have I done wrong... GO ALTER PROCEDURE [dbo].[AddTermsCond