How do I deselect a row in table control on scrren?
Hello All:
How do I write the code to deselect a row in table control on a screen? This is in dialog programming.
Thanks.
Mithun
I thought that the descriptions given in the Help are clear.
The ADDRESS function constructs a cell address string from separate row, column, and table identifiers.
ADDRESS(row, column, [type], [style], [table])
row: The row number of the address.
column: The column number of the address.
I dropped the comments about type, style and table as I don't use them here.
=IF(ISBLANK(INDIRECT(ADDRESS(ROW(),1))),"",INDIRECT(ADDRESS(ROW(),2))*INDIRECT(A DDRESS(ROW(),3)))
INDIRECT(ADDRESS(ROW(),1))
returns the contents of the cell whose row is the same than the one containing the formula \[the row number is given by ROW()] and whose column is the 1st one)
INDIRECT(ADDRESS(ROW(),2))
returns the contents of the cell whose row is the same than the one containing the formula \[the row number is given by ROW()] and whose column is the 2nd one)
INDIRECT(ADDRESS(ROW(),3))
returns the contents of the cell whose row is the same than the one containing the formula \[the row number is given by ROW()] and whose column is the 3rd one)
In short, when the formula is applied in row 9 it behaves like:
=IF(ISBLANK(A9),"",B9*C9)
The long syntax is required to be able to enter it only once in the header cell as described in the Help and in the PDF User Guide in a chapter entitled "Applying a Formula Once to Cells in a Column or Row".
As we want to use such a formula, it would be odd to destroy its ability using a different formula in a standard bottom row.
More, in a footer row, we may use shorter formulas than in other rows.
In a standard row 10 we would have to write =SUM(D2:D9)
in a footer row we enter only =SUM(D) which add the contents of every standard cells of the column D.
This feature is also described in the named resources.
Yvan KOENIG (from FRANCE vendredi 3 octobre 2008 18:21:13)
Similar Messages
-
How to select all the rows of table control in BDC
Hi All,
While I am doing BDC for Transaction Code MC88, After the first screen I will get another screen with tabble control, Here I need to select all the rows of table control, I am assignng the 'X' to the first field of Table Control which is the indicator for selection.
Here I am getting message called Indicator field is not in program and screen.
While doing Recording I am not able to record the indicator, Please any one let me know how to record the Entire table control selection.
Thanks in advance..Sorry about that lakshmi. Here is my code.
PERFORM dynpro USING : 'X' 'SAPMMCP6' '0105',
' ' 'RMCP2-MATNR' t_matnr,
' ' 'RMCP2-WERKS' t_werks,
' ' 'BDC_OKCODE' '=AKTV'.
PERFORM dynpro USING : 'X' 'SAPLMCPA' '0707',
' ' 'BDC_OKCODE' '=MRKE'.
PERFORM dynpro USING : 'X' 'SAPLMCPA' '0707',
' ' 'BDC_OKCODE' '=GRAO -
How can we select multiple rows in table control for module pool program?
hi guru's
i cannt able to select multiple table control rows for deletion of records please give any code to select rows?
regrards,
satheesh.On the Table Control attributes there is a "Selectability" option where you choose one of: None, Single, or Multiple. In your code you then need to pick up which rows have the selection column set to 'X'.
-
How to count number of rows in table
can I get number of row in table except Count(*) in pl/sql
is there any other wayAlso posted and answered here
how to count number of rows in table
count(*) will be the fastest way. It is only slow if the table has a vast number of rows, in which case why do you need to know the tables has 73552436467721 rows and not 73552436467737 rows. It doesn't seem to be much use. Either that or you are counting them a lot, which again seems rather pointless. -
How to Fix the 1st row in Table
How to Fix the 1st row in Table
In EP, one of the page we are getting out put in the table format. It's working fine, but as per the new requirement we have to fix (freeze) the first row of the table. (.i.e. whenever I click the page down button first row should be visible in the table). Can you help regarding the above issue?
For Example: in Table having 6 rows. In 1st row display Year Month and 2,3,4---etc Rows will display Quantity. Click on Page down Button in Table we are able to staring 2row. First was a movie up. So End user canu2019t find which year/moth under the Quantity is available.
So I have to fix in 1st row. Click on page down button table 1st row is fixed but comes to another Quantity Records.
It is Possible in Table? If possible please tell me.
Regards
Vijay KalluriHi KalluriVijay
I don't think there is direct availabe method available to fix the row. However, there are two ways using which you can achieve the requirement:
To go ahead with the custom table. This way you can set your own properties for the table. However, this may impact performance handling large data.
Second option is to use other features of NW04s (Not available in NW04) like Table Popins using which you can achieve something similar.
For Table Popins refer [TablePopin|http://help.sap.com/saphelp_nw70/helpdata/EN/23/5e9041d3c72e7be10000000a1550b0/frameset.htm]
Hope this helps.
Regards
Abhinav Sharma -
How to delete the row in table control with respect to one field in module pool programming?
Hi,
Can I know the way to delete the row in table control with respect to one field in module pool programming
Regards
Darshan MSHI,
I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
I have written this code,
module USER_COMMAND_9000 input.
DATA OK_CODE TYPE SY-UCOMM.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'DELETE'.
LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
APPEND LS_SOURCE TO LT_RESTORE.
DELETE TABLE LT_SOURCE FROM LS_SOURCE.
SOURCE-LINES = SOURCE-LINES - 1.
ENDLOOP.
But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
So I thought of doing with respect to the field. -
How to get all the index of "selected rows" in table control?
Hi Gurus,
I have a table control, wherein I need to get selected row so that I can get its respective TABIX.
I know that the event for capturing selected row is in PAI.
I also ensure that the w/ selColumn name in my screenpainter is exactly the same as my declaration in ABAP.
TOP INCLUDE
YPES: BEGIN OF Y_ZQID_CHECK,
IDNUM TYPE ZQID_CHECK-IDNUM,
WERKS TYPE ZQID_CHECK-WERKS,
MATNR TYPE ZQID_CHECK-MATNR,
LICHA TYPE ZQID_CHECK-LICHA,
LIFNR TYPE ZQID_CHECK-LIFNR,
ECOA_S TYPE ZQID_CHECK-ECOA_S,
ID_STAT TYPE ZQID_CHECK-ID_STAT,
ID_DATE TYPE ZQID_CHECK-ID_DATE,
FLAG_MAILCOA(1) TYPE C,
MARK(1) TYPE C, "Name of w/ SelColumn in ScreenPainter: T_ZQIDCHECK_DISCH-MARK
END OF Y_ZQID_CHECK.
DATA: T_ZQIDCHECK_DISCH TYPE STANDARD TABLE OF Y_ZQID_CHECK WITH HEADER LINE.
PAI
PROCESS AFTER INPUT.
* MODULE USER_COMMAND_9004.
LOOP AT T_ZQIDCHECK_DISCH.
MODULE READ_TC_DISCH .
ENDLOOP.
module READ_TC_DISCH input.
DATA: W_LINE_SEL TYPE SY-STEPL,
W_TABIX LIKE SY-TABIX.
GET CURSOR LINE W_LINE_SEL.
W_TABIX = TC_ID_ONLY-TOP_LINE + w_LINE_SEL - 1.
MODIFY T_ZQIDCHECK_DISCH INDEX TC_ID_ONLY-current_line.
If I am selecting single row, I can properly get the selected index via debug.
BUG:
When I'm selecting multiple rows in table control, only the last row is always being read inside the loop of my table control.
Please see the screenshot.
[url]http://img268.imageshack.us/img268/5739/tcselectedrows.jpg[url]
Notice in the debug screenshot, even if it's just in the 1st loop of table control, it automatically gets the 4th table control index, instead of the 2nd one.
Helpful inputs will be appreciated.
Thanks.
Jaime
Edited by: Jaime Cabanban on Dec 9, 2009 3:16 PMHi,
Are you sure that you have selected multiple line for tablecontrol in the property window of the tablecontrol.
Flowlogic.
LOOP WITH CONTROL TC_01.
Module Get_Marked.
ENDLOOP.
Module Pool
Module Get_Marked.
read the data from the internal table where mark = 'X'.
this should give you only selected records.
Endmodule.
Kindly check the tablecontrol property.
Regards,
Ranjith Nambiar -
How to select perticular row in table control for BDC
Hi all
I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
Please Suggest me. it urgent.
Thanks& Regards,
RPHi all
I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
Please Suggest me. it urgent.
Thanks& Regards,
RP -
How to set total number of rows of table control
Hi All,
I want to set the total number of rows of table control. I don't want to display the blank rows in table.
Regards,
ShrinivasNeed some fine tuning regarding the scrollbar height but it's a start
Unless this isn't what you asked for
Small number of rows
Large number of rows
Attachments:
PlayingWithTable.vi 17 KB -
How to validate the dates in the table control ?
How to validate the dates in the table control ?
Can I write like this ?
LOOP AT it_tab .
CHAIN.
FIELD : it_tab-strtdat,it_tab-enddat.
module date_validation.
ENDCHAIN.
ENDLOOP.
Module Date_validation.
ranges : vdat type sy-datum.
vdat-sign = 'I'.
VDAT-LOW = it_tab-STRTDAT.
VDAT-HIGH = it_tab-ENDDAT.
VDAT-OPTION = 'BT'.
APPEND VDAT.
WHAT CODE I have to write here to validate ?
and If I write like this How can we know which is the current row being add ?
It loops total internal table ..?
Bye,
Muttu.Hi,
I think there is no need to put chain endchain.
To do validation you have to write module in PAI which does required validations.
Thanks
DARSHAN PATEL -
Selecting rows in table control
Hi experts,
I have question regarding selecting rows in table control. How can I select a row when a button is pressed. I cannot use the selection column in this case. Is there any option to achieve my requirement without using the selection column. Thanks.
regards,
sriram.By,
Using the Get cursor syntax you can achive the Selected row in Table control.
DATA : selrow TYPE i,
selindex TYPE i .
* getting the cursor line in Table Control for selected row
GET CURSOR FIELD selfield LINE selrow.
selindex = <tablecontrol>-top_line + selrow - 1.
Prabhu -
Unable to delete a row in table control
Hi,
I'm unable to delete a row in table control.
I have defined a selection column for my table control but it is not getting value 'X' when i'm selecting a row for deletion.
Also, when I press enter, some of the columns in table control are getting initialized. I'm passing these values to the internal table along with other columns.
Please help.
Regards,
Manasee
Message was edited by: Manasee Chandorkarhi,
kindly chk this.
PROCESS BEFORE OUTPUT.
MODULE status_9010.
LOOP WITH CONTROL tab_control.
MODULE move_data_to_table.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL tab_control.
MODULE move_data_from_table.
ENDLOOP.
*& Module move_data_to_table OUTPUT
This is to move the data from the internal table to the table control
MODULE move_data_to_table OUTPUT.
This is to move the data from the internal table to the table control
zmpets_mode-modecode,zmpets_range-rangeid,zmpets_servfacto-factor are column name of table control
READ TABLE int_factor INDEX tab_control-current_line.
IF sy-subrc = 0.
zmpets_mode-modecode = int_factor-modecode.
zmpets_range-rangeid = int_factor-rangeid.
zmpets_servfacto-factor = int_factor-factor.
ENDIF.
ENDMODULE. " move_data_to_table OUTPUT
*& Module move_data_from_table INPUT
Date is moved from the table control to the Internal Table
MODULE move_data_from_table INPUT.
To move the data from the table control to internal table 'INT_FACTOR'.
int_factor-modecode = zmpets_mode-modecode.
int_factor-rangeid = zmpets_range-rangeid.
int_factor-factor = zmpets_servfacto-factor.
int_factor-chk = line.
*here if the data is there, it will modify
MODIFY int_factor INDEX tab_control-current_line.
IF sy-subrc NE 0. "data not exixting in table control . ie new data, then append it
APPEND int_factor.
CLEAR int_factor.
ENDIF.
ENDMODULE. " move_data_from_table INPUT
*delete a line from table control
MODULE user_command_9010 INPUT.
CASE sy-ucomm.
When an entry is deleted, and the entry is removed from the table
control.
WHEN 'DELETE'.
PERFORM f_del_frm_tab_cntrl.
ENDCASE.
ENDMODULE.
FORM f_del_frm_tab_cntrl .
LOOP AT int_factor WHERE chk = 'X'.
DELETE int_factor WHERE chk = 'X' .
CONTINUE.
ENDLOOP.
CLEAR int_factor.
ENDFORM.
for any clarifiaction pls mail me.
pls reward points, if this helped u.
regards,
anversha.
[email protected]
Message was edited by: Anversha s -
How to delete a column from the table control in module pool?
Hi,
can any one please tell How to delete a column from the table control in module pool?
thanks in advance
warm regards
HareeshKumar Nhi hareesh,
I think it is better to hide it.
How to hide: You can check this link
Dynamic Hide column in table control -
How to create screen resolution in bdc table control
hi gurus
can anyone suggest me
how to create screen resolution in bdc table control
thanks®ards
mark.Hi ,
Using CTU_PARAMS table for screen resolution .
For this sample code.
This is for Transation FB60.
report ZZFB60
no standard page heading line-size 255.
tables t100.
PARAMETERS : p_file1 like rlgrap-filename,
p_doctyp like RF05A-BUSCS,
p_invdat like INVFO-BLDAT,
p_posdat like INVFO-BUDAT.
CONSTANTS : C_TRANS_FB60(4) VALUE 'FB60'.
*Parameter string for runtime of CALL TRANSACTION
data : l_option type ctu_params,
l_subrc type sysubrc.
DATA : l_mstring(150).
data accnt type char17.
data : day type char2,
month type char2,
year type char4,
date1 type char10,
date2 type char10.
data : cnt(2) TYPE n,
cnt1 type i,
fld(25) TYPE c.
data : begin of excel occurs 0,
fieldname(255) type c,
end of excel.
DATA:BEGIN OF it_mess OCCURS 0,
msgtyp(5),
lms(200),
msgv1(50),
END OF it_mess.
data: begin of t_record occurs 0,
BUKRS(004),
ACCNT(017),
XBLNR(016),
WRBTR1(016),
WAERS(005),
SECCO(004) ,
SGTXT(050),
HKONT(010),
WRBTR2(017),
MWSKZ(002),
GSBER(004),
KOSTL(010),
end of t_record.
*Internal Table for Header Data
DATA : BEGIN OF t_head OCCURS 0,
BUKRS(004), "Company Code
ACCNT(017), "Account or Vendor
XBLNR(016), "Reference
WRBTR1(017), "Amount in document currency
WAERS(005), "Currency
SECCO(004), "Section Code
SGTXT(050), "Text
END OF t_head.
*Internal table for Item Data
DATA : BEGIN OF t_item OCCURS 0,
ACCNT(017), "Account
HKONT(010), "GL Account
WRBTR2(017), "Line item Amount in document currency
MWSKZ(002), "Tax Code
GSBER(004), " Business Area
KOSTL(010), "Cost centre
END OF t_item.
DATA: IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_BDC_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
*include bdcrecx1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
PERFORM file_selection.
PERFORM data_upload.
PERFORM table_control.
start-of-selection.
l_option-defsize = 'X'.
l_option-dismode = 'A'.
l_option-updmode = 'S'.
day = p_invdat+6(2).
month = p_invdat+4(2).
year = p_invdat+0(4).
concatenate day month year into date1 SEPARATED BY '.'.
day = p_posdat+6(2).
month = p_posdat+4(2).
year = p_posdat+0(4).
concatenate day month year into date2 SEPARATED BY '.'.
*perform open_group.
loop at t_head.
CLEAR IT_BDCDATA.
REFRESH IT_BDCDATA.
perform bdc_dynpro using 'SAPLACHD' '1000'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
perform bdc_field using 'BKPF-BUKRS' t_head-bukrs.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'RF05A-BUSCS' p_doctyp.
perform bdc_field using 'INVFO-ACCNT' t_head-accnt.
perform bdc_field using 'INVFO-BLDAT' date1.
perform bdc_field using 'INVFO-BUDAT' date2.
perform bdc_field using 'INVFO-XBLNR' t_head-xblnr.
perform bdc_field using 'INVFO-WRBTR' t_head-wrbtr1.
perform bdc_field using 'INVFO-WAERS' t_head-waers.
perform bdc_field using 'INVFO-SECCO' t_head-secco.
perform bdc_field using 'INVFO-SGTXT' t_head-sgtxt.
cnt = 1.
cnt1 = 1.
loop at t_item where accnt = t_head-accnt.
*if cnt > 4.
*cnt = 4.
*endif.
if cnt1 gt 1.
CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
perform bdc_field using fld 'X'.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE' '=0005'.
endif.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE' '/00'.
CONCATENATE 'ACGL_ITEM-HKONT(' cnt ')' INTO fld.
perform bdc_field using fld t_item-hkont.
CONCATENATE 'ACGL_ITEM-WRBTR(' cnt ')' INTO fld.
perform bdc_field using fld t_item-wrbtr2.
CONCATENATE 'ACGL_ITEM-MWSKZ(' cnt ')' INTO fld.
perform bdc_field using fld t_item-mwskz.
CONCATENATE 'ACGL_ITEM-GSBER(' cnt ')' INTO fld.
perform bdc_field using fld t_item-gsber.
CONCATENATE 'ACGL_ITEM-KOSTL(' cnt ')' INTO fld.
perform bdc_field using fld t_item-kostl.
perform bdc_field using 'BDC_CURSOR' fld.
*CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
*perform bdc_field using fld 'X'.
cnt1 = cnt1 + 1.
*cnt = cnt + 1.
*if cnt > 1.
*perform bdc_dynpro using 'SAPMF05A' '1100'.
*perform bdc_field using 'BDC_OKCODE' '=0005'.
**perform bdc_field using 'BDC_OKCODE' '=0006'.
*endif.
endloop.
perform bdc_dynpro using 'SAPMF05A' '1100'.
perform bdc_field using 'BDC_OKCODE'
'=BS'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
*perform bdc_transaction using 'FB60'.
CALL TRANSACTION C_TRANS_FB60 USING IT_BDCDATA options from l_option
MESSAGES INTO IT_BDC_MESSAGES.
perform error.
perform errordownload.
endloop.
*perform close_group.
*Form data_upload
FORM data_upload .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = p_file1
FILETYPE = 'DAT'
TABLES
DATA_TAB = t_record.
ENDFORM. " data_upload
*Form file_selection
FORM file_selection .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'p_file1'
IMPORTING
file_name = p_file1.
ENDFORM. " file_selection
Form BDC_DYNPRO
FORM BDC_DYNPRO using program dynpro.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROGRAM.
IT_BDCDATA-DYNPRO = DYNPRO.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
endform.
*Form BDC_FIELD
FORM bdc_field using fnam fval.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDFORM.
Table Control
FORM table_control .
LOOP AT t_record.
ON CHANGE OF t_record-accnt.
MOVE-CORRESPONDING t_record TO t_head.
APPEND t_head.
ENDON.
loop at t_head.
t_item-accnt = t_head-accnt.
t_item-hkont = t_record-hkont.
t_item-wrbtr2 = t_record-wrbtr2 .
t_item-mwskz = t_record-mwskz .
t_item-gsber = t_record-gsber .
t_item-kostl = t_record-kostl.
APPEND t_item.
endloop.
If t_record-level = 'H'.
t_head-bukrs = t_record-text1.
t_head-accnt = t_record-text2.
t_head-xblnr = t_record-text3.
t_head-wrbtr1 = t_record-text4.
t_head-waers = t_record-text5.
t_head-secco = t_record-text6.
t_head-sgtxt = t_record-text7.
APPEND t_head.
else.
t_item-accnt = t_head-accnt.
t_item-hkont = t_record-text1.
t_item-wrbtr2 = t_record-text2.
t_item-mwskz = t_record-text3.
t_item-gsber = t_record-text4.
t_item-kostl = t_record-text5.
APPEND t_item.
endif.
ENDLOOP.
ENDFORM.
FORM error .
LOOP AT IT_BDC_MESSAGES.
IF IT_BDC_MESSAGES-msgtyp = 'E'.
SELECT single * FROM t100 WHERE
sprsl = it_BDC_MESSAGES-msgspra
AND arbgb = IT_BDC_MESSAGES-msgid
AND msgnr = IT_BDC_MESSAGES-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
REPLACE '&2' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
REPLACE '&3' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
REPLACE '&4' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
REPLACE '&' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
APPEND it_mess.
ELSE.
it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
APPEND it_mess.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
form errordownload.
*down the internal table to excel file.
call function 'EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = 'c:/Error.xls'
TABLES
data_tab = it_mess
fieldnames = excel
EXCEPTIONS
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_filename = 6
invalid_pivot_fields = 7
download_problem = 8
others = 9.
endform.
Reward if useful
Regards,
Narasimha
Edited by: narasimha marella on May 13, 2008 12:12 PM -
BDC : to select different rows in table control
Hi,
I have to fill many rows in table control and want to select different row one by one in increasing order which rows are filled in BDC.
Can anybody suggest me with coding...
thanks
nareshHi ,
I am attaching sample code for BDC transaction code is : FV11 , This code is also contains poage down concepts . By using this page down concept you can add number of item fields
Program Name : ZFV11_NEW
Program Description : To Upload Condition Records-FV11
Author : Jagadish
Start Date : 11/06/2007
REPORT zfv11
NO STANDARD PAGE HEADING LINE-SIZE 255.
DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
If it is nessesary to change the data section use the rules:
1.) Each definition of a field exists of two lines
2.) The first line shows exactly the comment
'* data element: ' followed with the data element
which describes the field.
If you don't have a data element use the
comment without a data element name
3.) The second line shows the fieldname of the
structure, the fieldname must consist of
a fieldname and optional the character '_' and
three numbers and the field length in brackets
4.) Each field must be type C.
Generated data section with specific formatting - DO NOT CHANGE ***
TABLES : t100.
DATA: BEGIN OF record OCCURS 0,
data element: KSCHA
kschl(004), "Condition Type
data element: SELKZ_LIST
selkz(001),
data element: WERKS_D
werks(004), "Plant
data element: ELIFN
lifnr(010), "Vendor
data element: MATNR
matnr(018), "Material No.
data element: KBETR_KOND
kbetr(016), "Amount
data element: KODATAB
datab(010), "Condition Validity Date from
data element: KODATBI
datbi(010), "Condition Validity To
data element: MWSKZ
mwsk1(002),
END OF record.
DATA : BEGIN OF it_new OCCURS 0, " Internal Table for Header Data
kschl(004),
werks(004),
lifnr(010),
END OF it_new.
DATA : BEGIN OF it_item OCCURS 0, " Internal table for Item Data
werks(004),
lifnr(010),
matnr(018),
kbetr(016),
datab(010),
datbi(010),
mwsk1(002),
END OF it_item.
DATA : cnt(2) TYPE n,
fld(25) TYPE c.
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
DATA : n TYPE n.
DATA:
BEGIN OF t_data OCCURS 0,
data TYPE string,
END OF t_data.
DATA:BEGIN OF it_mess OCCURS 0,
msgtyp(5),
lms(200),
msgv1(50),
END OF it_mess.
DATA : p_mode TYPE c.
DATA:it_msgtab TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE,
it_msgtab1 TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
DATA : l_mstring(150).
DATA : BEGIN OF bdcdata OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
PARAMETERS : p_file1 LIKE rlgrap-filename.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
PERFORM file_selection.
PERFORM data_upload.
PERFORM table_control.
LOOP AT it_new.
REFRESH bdcdata.
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RV13A-KSCHL'
it_new-kschl.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KONP-KBETR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'KOMG-WERKS'
it_new-werks.
PERFORM bdc_field USING 'KOMG-LIFNR'
it_new-lifnr.
DATA: "X(5) TYPE N,
N(5) TYPE N.
N = 0.
LOOP AT it_item.
N = N + 1.
ENDLOOP.
"X = 1.
CNT = 1.
DO N TIMES.
IF CNT > 19.
perform bdc_field using 'BDC_OKCODE' 'KOMG-MATNR(01)'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
CNT = 1.
ENDIF.
cnt = 1.
LOOP AT it_item WHERE werks EQ it_new-werks AND lifnr EQ it_new-lifnr . "FROM x TO x.
CONCATENATE 'KOMG-MATNR(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-matnr.
CONCATENATE 'KONP-KBETR(' cnt')' INTO fld.
PERFORM bdc_field USING fld it_item-kbetr.
CONCATENATE 'RV13A-DATAB(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-datab.
CONCATENATE 'RV13A-DATBI(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-datbi.
CONCATENATE 'KONP-MWSK1(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-mwsk1.
cnt = cnt + 1.
if cnt = 20.
perform bdc_field using 'BDC_OKCODE' 'KOMG-MATNR(19)'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
CNT = 1.
endif.
CLEAR it_item.
ENDLOOP.
ENDDO.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KONP-MWSK1(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'FV11' USING bdcdata MODE 'A'
UPDATE 'S'
MESSAGES INTO it_msgtab.
CLEAR bdcdata[].
PERFORM error.
ENDLOOP.
Start new screen -Subroutine for screen s *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field -Subroutine for field s *
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
*& Form file_selection
FORM file_selection .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE1'
IMPORTING
file_name = p_file1.
ENDFORM. " file_selection
*& Form data_upload
FORM data_upload .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file1
TABLES
i_tab_converted_data = record
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " data_upload
*& Form error
FORM error .
LOOP AT it_msgtab.
IF it_msgtab-msgtyp = 'E'.
SELECT SINGLE * FROM t100 WHERE sprsl = it_msgtab-msgspra
AND arbgb = it_msgtab-msgid
AND msgnr = it_msgtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH it_msgtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH it_msgtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH it_msgtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH it_msgtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH it_msgtab-msgv1 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv2 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv3 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
it_mess-msgtyp = it_msgtab-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = it_msgtab-msgv1.
APPEND it_mess.
WRITE: / it_msgtab-msgtyp, l_mstring(150).
ELSE.
WRITE: / it_msgtab.
it_mess-msgtyp = it_msgtab-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = it_msgtab-msgv1.
APPEND it_mess.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " error
*& Form table_Control
FORM table_control .
SORT record BY lifnr matnr.
LOOP AT record.
ON CHANGE OF record-lifnr.
MOVE-CORRESPONDING record TO it_new.
APPEND it_new.
ENDON.
MOVE-CORRESPONDING record TO it_item.
APPEND it_item.
ENDLOOP.
ENDFORM. " table_Control
Reward if useful
Thanks
Jagadeesh.G
Maybe you are looking for
-
How do I use 2 different iTunes Stores?
How do I use 2 different iTunes Stores simultateously? Active account in South Africa, but need to download apps from the German iTunes Store - which iTunes does not allow, as these apps do not appear on the South African iTunes Store.
-
When I forward an e-mail from my iPad or iPhone, the pictures in the signature are sent as attachments. How can this be corrected?
-
Scene "FLUTTER" in edited video...???
I hope everyone is having a nice Xmas. I have successfully edited a couple of videos, taking clips from our previous work on DVD or VHS tape copies. These will be kind of "demo" reels for our website. The videos work fine while in CS5 and everythi
-
folks need a little help i have a iphone, with 2 different email address from comcast (x and y) phone has email address x and y email address x has the inbox tab, sent tab,trash tab email address y has only inbox tab, but no sent tab or trash tab how
-
Correct mixed orientations on contact sheet
Hi! I want to print a contact sheet from an iPhoto 6.0.6 album of 13 pictures. In the album they all show the same (portrait) orientation. But when I go to 'Print' 2 of the pictures are sideways on. How do I get a contact sheet print with everything