Hi All,What is the concept of table control in bdc
Hi All,What is the concept of table control in bdc .Can u please explain in brief.How we have to handle the logic for va01 transaction .
Thanks®ards.
Bharat
Hi Kaushik Datta ,
I already know for me51 ,but i am getting the problem for va01 while populating the item details in to the table control. The code which i have generated is :
please see the code and tell me where i should increment the counter for populating the item details
report ZBKVA01Y
no standard page heading line-size 255.
include bdcrecx1.
parameters: dataset(132) lower case.
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.
DATA: BEGIN OF IT_DUMMY OCCURS 0,
TEXT(1000),
END OF IT_DUMMY.
Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of IT_HEADER OCCURS 0,
data element: AUART
AUART_001(004),
data element: VKORG
VKORG_002(004),
data element: VTWEG
VTWEG_003(002),
data element: SPART
SPART_004(002),
data element: BSTKD
BSTKD_005(035),
data element: BSTDK
BSTDK_006(010),
data element: KUNAG
KUNNR_007(010),
data element: KUNWE
KUNNR_008(010),
data element: ABHOZ
ABHOV_009(008),
data element: ABHOZ
ABHOB_010(008),
data element: PRSDT
PRSDT_011(010),
END OF IT_HEADER.
DATA: BEGIN OF IT_ITEM OCCURS 0,
data element: MATNR
MABNR_01_012(018),
data element: KWMENG
KWMENG_01_013(019),
end of IT_ITEM.
*DATA: DATE(10) TYPE C.
*DATA: I_DATE TYPE SY-DATUM.
*DATA: I_YEAR(4) TYPE C,
I_MONTH(2) TYPE C,
I_DAY(2) TYPE C .
*DATA:
End generated data section ***
start-of-selection.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = ' '
FILETYPE = ' '
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
DATA_TAB = IT_DUMMY
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.
*perform open_dataset using dataset.
LOOP AT IT_DUMMY.
IF IT_DUMMY-TEXT+0(1) = 'H'.
IT_HEADER-AUART_001(004) = IT_DUMMY-TEXT+1(4).
data element: VKORG
IT_HEADER-VKORG_002(004) = IT_DUMMY-TEXT+5(4).
data element: VTWEG
IT_HEADER-VTWEG_003(002) = IT_DUMMY-TEXT+9(2).
data element: SPART
IT_HEADER-SPART_004(002) = IT_DUMMY-TEXT+11(2).
data element: BSTKD
IT_HEADER-BSTKD_005(035) = IT_DUMMY-TEXT+13(35).
data element: BSTDK
IT_HEADER-BSTDK_006(010) = IT_DUMMY-TEXT+48(8).
data element: KUNAG
IT_HEADER-KUNNR_007(010) = IT_DUMMY-TEXT+56(10).
data element: KUNWE
IT_HEADER-KUNNR_008(010) = IT_DUMMY-TEXT+66(10).
data element: ABHOZ
IT_HEADER-ABHOV_009(008) = IT_DUMMY-TEXT+76(6).
data element: ABHOZ
IT_HEADER-ABHOB_010(008) = IT_DUMMY-TEXT+82(6).
data element: PRSDT
IT_HEADER-PRSDT_011(010) = IT_DUMMY-TEXT+88(8).
APPEND IT_HEADER.
CLEAR IT_HEADER.
ELSEIF IT_DUMMY-TEXT+0(1) = 'I'.
data element: MATNR
IT_ITEM-MABNR_01_012(018) = IT_DUMMY-TEXT+1(18).
data element: KWMENG
IT_ITEM-KWMENG_01_013(019) = IT_DUMMY-TEXT+19(15).
APPEND IT_ITEM.
CLEAR IT_ITEM.
ENDIF.
ENDLOOP.
perform open_group.
LOOP AT IT_HEADER.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-SPART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-AUART'
IT_HEADER-AUART_001.
perform bdc_field using 'VBAK-VKORG'
IT_HEADER-VKORG_002.
perform bdc_field using 'VBAK-VTWEG'
IT_HEADER-VTWEG_003.
perform bdc_field using 'VBAK-SPART'
IT_HEADER-SPART_004.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
IT_HEADER-BSTKD_005.
perform bdc_field using 'VBKD-BSTDK'
IT_HEADER-BSTDK_006.
perform bdc_field using 'KUAGV-KUNNR'
IT_HEADER-KUNNR_007.
perform bdc_field using 'KUWEV-KUNNR'
IT_HEADER-KUNNR_008.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'04/05'.
perform bdc_field using 'BDC_OKCODE'
'=CHOO'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'VBAK-ABHOV'
IT_HEADER-ABHOV_009.
perform bdc_field using 'VBAK-ABHOB'
IT_HEADER-ABHOB_010.
perform bdc_field using 'VBKD-PRSDT'
IT_HEADER-PRSDT_011.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
IT_ITEM-MABNR_01_012.
perform bdc_field using 'RV45A-KWMENG(01)'
IT_ITEM-KWMENG_01_013.
perform bdc_transaction using 'VA01'.
*enddo.
ENDLOOP.
perform close_group.
*perform close_dataset using dataset.
Thanks®ards.
Bharat .
Similar Messages
-
What is the use of table control in bdc is it same in module pool table con
Hi,
What is the use of table control in bdc is it same in module pool table control?
regards
eswarHi,
Table control means it contains as table and it will scroll in vertical and horizontal.
In module pool by using screen we can create new table control.
But BDC table control means here we can populate the data into the table control.
i.e.if you take VA01 for sales order creation in the belwo of VA01 screen there is table control for the filling of material details so here we will write the code to populate the data into the table control screen.
Thanks and regards,
shyla -
Concept of table control in BDC
hi friends,
what is the concept of table control in BDC
regards,
malleswari.Hey Malleswari,
Please refer the program given at the following link to understand the concept of BDC:
<a href="http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm">http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm</a>
Regards,
Chetan.
PS: Reward points if this helps u. -
Hi All, How we can handle a table control in bdc - in detail its urgent pls
Hi All, How we can handle a table control in bdc - in detail its urgent. Please send me the explanation in detail.
Thanks®ards.
Bharathi,
Create Table Control
Step 1 (Create new structure for table control)
Type is name of structure (ZTC_EKKO) and press create
Step 2 (Create Program)
Goto transaction SE80(Object Navigator) -> Repository Browser -> Program.
Enter your program name, please ensure that is begins with SAPMZ as this is a module pool (dialog program).
Press enter to create, and press yes!
Ensure that you create a top include, and press Enter.
Accept the name created for the top include.
Press Enter.
Press Save
Step 3 (Create TOP include)
Double click on the top include and enter following ABAP code:
Tables: ZTC_EKKO.
controls: tc100 type tableview using screen 100.
data: ok_code type sy-ucomm.
data: it_ekko type standard
table of ZTC_EKKO initial size 0,
wa_ekko type ZTC_EKKO.
data: ok_code type sy-ucomm.
Press Save and Activate
Step 4 (Create screen)
Right click the program to create a screen 100 for the dialog. Enter Short description, set screen type to Normal and enter 0 or blank into Next screen. Then move to Element List tab and enter the OK code as OK_CODE (i.e. the same as what you declared in the top include with data: ok_code type sy-ucomm).
Step 5 (Create table control)
Press the Layout button to bring up the screen painter editor.
Press table control button and drag it on to the screen, enter the name of table control created in TOP include (TC100). Now press the yellow button for attributes and set the table control as below options
Step 6 (Populate table control )
Press the orange button (Fields). On the next screen enter ZTC_EKKO and press the Get from Dict button. Select the fields you want (all) and press enter. Now drag them onto your Table Control.
Below is the result, there will been syntax errors if we check now! So Save and go back into the flow logic tab.
Step 7 (Create flow control )
Within the flow logic of screen 100 and create two modules, one to select the data from the database and the other to move the selected fields into the table control. Also insert the two loop statements to populate and retrieve the lines of the table control.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
module data_retrieval.
loop at it_ekko into wa_ekko with control TC100.
module populate_screen.
endloop.
PROCESS AFTER INPUT.
loop at it_ekko.
endloop.
MODULE USER_COMMAND_0100.
Double click the module data_retrieval to create and click yes to get past the popup. Ensure that a new include is created to hold all the PBO modules (default). Press enter.
Select 10 rows of data from the EKKO table and load into the internal table it_ekko. Go back to the flow logic to load this data into the Table Control.
check this one
REPORT ZCALL_TRANS_TAB1 .
TABLES: LFA1,LFBK,lfb1.
data: BEGIN OF it_vendor occurs 0,
LIFNR LIKE LFA1-LIFNR,
bukrs like lfb1-bukrs,
END OF it_vendor.
DATA: BEGIN OF IT_BANK occurs 0,
LIFNR LIKE LFA1-LIFNR,
BANKS LIKE LFBK-BANKS,
BANKL LIKE LFBK-BANKL,
BANKN LIKE LFBK-BANKN,
koinh like lfbk-koinh,
END OF IT_BANK.
data: it_bdcdata like bdcdata occurs 0 with header line.
data: it_messages like bdcmsgcoll occurs 0 with header line.
*selection screen.
selection-screen: begin of block b1 with frame.
parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
obligatory.
parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
obligatory.
selection-screen: end of block b1.
*at selection screen.
at selection-screen on value-request for p_file.
perform f4_help using p_file.
at selection-screen on value-request for p_file1.
perform f4_help1 using p_file1.
*start of selection
start-of-selection.
*******uploading file
perform upload_file using p_file P_FILE1.
******open session.
perform populate_data.
*& Form f4_help
form f4_help using p_p_file.
data: l_file type ibipparms-path.
call function 'F4_FILENAME'
importing
file_name = l_file.
p_file = l_file.
endform. " f4_help
*& Form POPULATE_DATA
form populate_data .
DATA: L_STRING TYPE STRing.
DATA: L_COUNTER(2) TYPE n.
loop at it_vendor.
perform bdc_dynpro using 'SAPMF02K' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-D0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
it_vendor-lifnr.
perform bdc_field using 'RF02K-BUKRS'
it_vendor-bukrs.
perform bdc_field using 'RF02K-D0130'
'X'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-bankn(03)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
*********bank details
CLEAR l_COUNTER.
LOOP AT IT_BANK WHERE LIFNR = IT_VENDOR-LIFNR.
l_COUNTER = l_COUNTER + 1.
clear l_string.
CONCATENATE 'lfbk-banks(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-banks.
clear l_string.
CONCATENATE 'lfbk-bankl(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-bankl.
clear l_string.
CONCATENATE 'lfbk-bankn(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-bankn.
endloop.
******CALL TRANSACTION.
call transaction 'FK02' using it_bdcdata mode 'A'
messages into it_messages.
write:/ sy-subrc.
perform format_messages.
clear it_bdcdata.
refresh it_bdcdata.
endloop.
endform. " POPULATE_DATA
*& Form FORMAT_MESSAGES
form format_messages .
data: l_msg(100).
loop at it_messages.
call function 'FORMAT_MESSAGE'
exporting
id = it_messages-msgid
lang = sy-langu
no = it_messages-msgnr
v1 = it_messages-msgv1
v2 = it_messages-msgv2
v3 = it_messages-msgv3
v4 = it_messages-msgv4
importing
msg = l_msg
exceptions
not_found = 1
others = 2
write:/ l_msg.
endloop.
endform. " FORMAT_MESSAGES
*& Form bdc_dynpro
form bdc_dynpro using value(p_program)
value(p_screen).
it_bdcdata-program = p_program.
it_bdcdata-dynpro = p_screen.
it_bdcdata-dynbegin = 'X'.
append it_bdcdata.
clear it_bdcdata.
endform. " bdc_dynpro
*& Form bdc_field
form bdc_field using value(p_fnam)
value(p_fval).
it_bdcdata-fnam = p_fnam.
it_bdcdata-fval = p_fval.
append it_bdcdata.
clear it_bdcdata.
endform. " bdc_field
*& Form upload_file
form upload_file using p_p_file
p_p_file1.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_P_FILE
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = IT_VENDOR
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
STOP.
ENDIF.
*******UPLOADING BANK DETAILS
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_P_FILE1
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = IT_BANK
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
STOP.
ENDIF.
endform. " upload_file
*& Form f4_help1
-->P_P_FILE1 text
form f4_help1 using p_p_file1.
data:l_file1 type ibipparms-path.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = l_file1.
p_file1 = l_file1.
endform. " f4_help1
http://sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Regards,
Sankar -
What are the uses of table control and tabstrip control
can anyone tell me the uses of table control and tabstrip control
Hi,
table control is more comfortable for customizing.scroll bars all possible in this.where as it is not possible in step loops.
check this example.
PROGRAM ZBHTCTRL.
TABLES: LFA1, EKKO.
DATA: OKCODE1 LIKE SY-UCOMM,
OKCODE2 LIKE SY-UCOMM.
CONTROLS TABC TYPE TABLEVIEW USING SCREEN 1001.
DATA: BEGIN OF ITAB OCCURS 0,
MANDT LIKE EKKO-MANDT,
EBELN LIKE EKKO-EBELN,
BSTYP LIKE EKKO-BSTYP,
BSART LIKE EKKO-BSART,
END OF ITAB.
MODULE USER_COMMAND_1000 INPUT.
CASE OKCODE1.
WHEN 'BACK'.
SET SCREEN 0.
WHEN 'NEXT'.
SET SCREEN 1001.
SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE
LIFNR = LFA1-LIFNR.
ENDCASE.
ENDMODULE. " USER_COMMAND_1001 INPUT
MODULE MOVE_DATA OUTPUT.
EKKO-MANDT = ITAB-MANDT.
EKKO-EBELN = ITAB-EBELN.
EKKO-BSTYP = ITAB-BSTYP.
EKKO-BSART = ITAB-BSART.
ENDMODULE. " MOVE_DATA OUTPUT
MODULE USER_COMMAND_1001 INPUT.
CASE OKCODE2.
WHEN 'BACK'.
SET SCREEN 1000.
ENDCASE.
ENDMODULE. " USER_COMMAND_1001 OUTPUT
MODULE STATUS_1001 OUTPUT.
SET PF-STATUS 'MENU'.
SET TITLEBAR 'TIT'.
ENDMODULE. " STATUS_1001 OUTPUT
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'DMENU'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_1000 OUTPUT
FORM ON_CTMENU_FORM1 USING CMENU TYPE REF TO CL_CTMENU.
CALL METHOD CMENU->LOAD_GUI_STATUS
EXPORTING
PROGRAM = ' ZBHTCTRL'
STATUS = 'CMENU'
MENU = CMENU.
CALL METHOD CMENU->ADD_FUNCTION
EXPORTING
FCODE = 'RX'
TEXT = 'RECIEVE'.
ENDFORM.
FLOW LOGIC:
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
PROCESS BEFORE OUTPUT.
MODULE STATUS_1001.
LOOP AT ITAB WITH CONTROL TABC CURSOR TABC-TOP_LINE.
MODULE MOVE_DATA.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1001.
LOOP AT ITAB.
ENDLOOP.
for more info check this link.
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
thanks
Ashu. -
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 populate the data in table control in BDC?
pls urgent?
hi,
see the below code .
FORM create_bdc_session .
DATA : w_saved_tx.
DATA g_r_itab TYPE typ_itab_rec.
CLEAR g_t_itab.
CLEAR g_r_itab.
LOOP AT g_t_itab INTO g_r_itab.
skip error lines
IF g_r_itab-ebeln = 'ERROR'.
CONTINUE.
ENDIF.
open Bdc session
AT FIRST.
PERFORM bdc_open_group.
ENDAT.
g_t_itab = g_r_itab.
On change in agreement number
AT NEW ebeln.
PERFORM bdc_header.
CLEAR: w_dtl_cnt_i, w_line_i.
ENDAT.
save at full page
IF w_line_i > 11.
PERFORM bdc_save.
PERFORM bdc_header_change.
w_line_i = 1.
ENDIF.
detail material processing
PERFORM bdc_detail.
CLEAR w_saved_tx .
save at end of agreement
AT END OF ebeln.
IF w_saved_tx NE 'Y' AND w_dtl_cnt_i > 0.
PERFORM bdc_save.
ENDIF.
w_saved_tx = 'Y'.
ENDAT.
ENDLOOP.
PERFORM bdc_close_group.
ENDFORM. " CREATE_BDC_SESSION
*& Form BDC_OPEN_GROUP
text
--> p1 text
<-- p2 text
FORM bdc_open_group .
DATA w_user_tx LIKE apqi-userid.
w_user_tx = sy-uname.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = p_bdc
keep = 'X'
user = w_user_tx
EXCEPTIONS
client_invalid = 01
destination_invalid = 02
group_invalid = 03
holddate_invalid = 04
internal_error = 05
queue_error = 06
running = 07
user_invalid = 08.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
WRITE: / 'BDC OPEN ERROR', sy-subrc.
ENDCASE.
ENDFORM. " BDC_OPEN_GROUP
*& Form BDC_HEADER
text
--> p1 text
<-- p2 text
FORM bdc_header .
REFRESH bdcdata.
CLEAR bdcdata.
determine now if text exists
CLEAR w_text_lines_i.
Transaction ME31K.
PERFORM bdc_dynpro USING 'SAPMM06E' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'EKKO-LIFNR' g_t_itab-lifnr.
PERFORM bdc_field USING 'RM06E-EVART' 'MK'.
PERFORM bdc_field USING 'RM06E-EVRTN' g_t_itab-ebeln.
PERFORM bdc_field USING 'EKKO-EKORG' g_t_itab-ekorg.
PERFORM bdc_field USING 'EKKO-EKGRP' g_t_itab-ekgrp.
Item category is on a detail line, but is entered on the entry screen
IF g_t_itab-pstyp = '3'.
g_t_itab-pstyp = 'L'.
ELSE.
CLEAR g_t_itab-pstyp.
ENDIF.
PERFORM bdc_field USING 'RM06E-EPSTP' g_t_itab-pstyp.
PERFORM bdc_field USING 'RM06E-WERKS' p_nwerks.
PERFORM bdc_field USING 'RM06E-LGORT' g_t_itab-lgort.
PERFORM bdc_dynpro USING 'SAPMM06E' '0201'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'EKKO-WAERS' g_t_itab-waers.
WRITE sy-datum TO w_date_tx DD/MM/YYYY.
PERFORM bdc_field USING 'EKKO-KDATB' '01.06.2004'.
PERFORM bdc_field USING 'EKKO-KDATE' '31.12.2999'.
w_tcode = 'ME31K'.
ENDFORM. " BDC_HEADER
*& Form BDC_SAVE
text
--> p1 text
<-- p2 text
FORM bdc_save .
final save
PERFORM bdc_dynpro USING 'SAPMM06E' '0220'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.
needed for some boxes (save anyway message)
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE' '=YES'.
Insert the transaction into the BDC session.
PERFORM bdc_insert USING w_tcode.
REFRESH bdcdata.
CLEAR bdcdata.
ENDFORM. " BDC_SAVE
*& Form BDC_HEADER_change
text
--> p1 text
<-- p2 text
FORM bdc_header_change .
DATA: w_pos LIKE rm06e-ebelp.
REFRESH bdcdata.
CLEAR bdcdata.
determine now if text exists
CLEAR w_text_lines_i.
Transaction ME32K.
PERFORM bdc_dynpro USING 'SAPMM06E' '0205'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RM06E-EVRTN' g_t_itab-ebeln.
PERFORM bdc_dynpro USING 'SAPMM06E' '0220'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
w_pos = g_t_itab-ebelp - 10.
PERFORM bdc_field USING 'RM06E-EBELP' w_pos.
w_tcode = 'ME32K'.
ENDFORM. " BDC_HEADER_change
*& Form BDC_INSERT
text
-->P_W_TCODE text
FORM bdc_insert USING p_w_tcode.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = w_tcode
TABLES
dynprotab = bdcdata
EXCEPTIONS
internal_error = 01
not_open = 02
queue_error = 03
tcode_invalid = 04.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
WRITE: / 'BDC INSERT ERROR', sy-subrc.
ENDCASE.
ENDFORM. " BDC_INSERT
*& Form BDC_CLOSE_GROUP
text
--> p1 text
<-- p2 text
FORM bdc_close_group .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
CASE sy-subrc.
WHEN 0.
WHEN OTHERS.
WRITE: / 'BDC CLOSE ERROR', sy-subrc.
ENDCASE.
ENDFORM. " BDC_CLOSE_GROUP
*& Form bdc_dynpro
text
-->P_0658 text
-->P_0659 text
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
*& Form BDC_FIELD
text
-->P_0688 text
-->P_W_POS text
FORM bdc_field USING field value.
CLEAR bdcdata.
bdcdata-fnam = field.
bdcdata-fval = value.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
*& Form load_dataset
text
--> p1 text
<-- p2 text
FORM load_dataset .
load dataset
LOOP AT g_t_itab INTO g_r_itab.
Load dataset with records needed for direct input
MOVE-CORRESPONDING g_r_itab TO g_t_itab.
AT NEW ebeln.
PERFORM load_dataset_mbepoh USING w_phys_outfil1_tx.
ENDAT.
PERFORM load_dataset_mbepoi USING w_phys_outfil1_tx.
ENDLOOP.
ENDFORM. " load_dataset
*& Form load_dataset_mbepoh
text
-->P_W_PHYS_OUTFIL1_TX text
FORM load_dataset_mbepoh USING p_dataset.
CLEAR rec1.
MOVE-CORRESPONDING g_t_itab TO rec1.
rec1-stype = '1'.
rec1-ernam = sy-uname.
TRANSFER rec1 TO p_dataset.
ENDFORM. " load_dataset_mbepoh
*& Form load_dataset_mbepoi
text
-->P_W_PHYS_OUTFIL1_TX text
FORM load_dataset_mbepoi USING p_dataset.
CLEAR rec2.
fields for MBEPOH
ADD 1 TO w_good_i.
MOVE-CORRESPONDING g_t_itab TO rec2.
rec2-stype = '2'.
rec2-werks = p_nwerks.
rec2-ematn = g_t_itab-matnr.
TRANSFER rec2 TO p_dataset.
ENDFORM. " load_dataset_mbepoi
*& Form BDC_DETAIL
text
--> p1 text
<-- p2 text
FORM bdc_detail .
DATA: w_ktmng_tx(11),
w_peinh_tx(5) TYPE c,
w_price_p(13) TYPE p DECIMALS 6,
w_price2_p(13) TYPE p DECIMALS 2,
w_price3_p(13) TYPE p DECIMALS 3,
w_price0_p(13) TYPE p DECIMALS 0,
w_cent_p TYPE p DECIMALS 2,
w_peinh_n(5) TYPE n,
w_price_tx(14).
accumulate lines to determine if page_down required
ADD 1 TO w_addit_i.
ADD 1 TO w_dtl_cnt_i.
ADD 1 TO w_line_i.
IF w_line_i > 12.
w_line_i = 2.
PERFORM bdc_dynpro USING 'SAPMM06E' '0220'.
PERFORM bdc_field USING 'BDC_OKCODE' '=NP'.
ENDIF.
get material unit of measure
CLEAR mara-meins.
SELECT SINGLE * FROM mara WHERE matnr = g_t_itab-matnr.
w_price_tx = g_t_itab-netpr.
w_peinh_tx = g_t_itab-peinh.
IF g_t_itab-ktmng = 0.
g_t_itab-ktmng = 1.
ENDIF.
w_ktmng_tx = g_t_itab-ktmng.
get decimal places of currency
TCURX-CURRDEC = 2.
SELECT SINGLE * FROM TCURX WHERE CURRKEY = g_t_itab-waers.
multiply Price
W_PRICE_P = g_t_itab-netpr.
CASE TCURX-CURRDEC.
WHEN 0.
W_PRICE_P = g_t_itab-netpr * 100.
W_PRICE0_P = W_PRICE_P.
W_PRICE_TX = W_PRICE0_P.
WHEN 2.
W_PRICE2_P = W_PRICE_P.
W_PRICE_TX = W_PRICE2_P.
WHEN 3.
W_PRICE3_P = W_PRICE_P.
W_PRICE_TX = W_PRICE3_P.
ENDCASE.
material overview screen (with enter)
PERFORM bdc_dynpro USING 'SAPMM06E' '0220'.
PERFORM bdc_field USING 'BDC_OKCODE' '=DETA'.
PERFORM bdc_field_idx USING 'RM06E-TCSELFLAG' 'X' w_line_i.
PERFORM bdc_field_idx USING 'EKPO-EMATN' g_t_itab-matnr w_line_i.
PERFORM bdc_field_idx USING 'EKPO-KTMNG' w_ktmng_tx w_line_i.
PERFORM bdc_field_idx USING 'EKPO-NETPR' w_price_tx w_line_i.
PERFORM bdc_field_idx USING 'EKPO-PEINH' w_peinh_tx w_line_i.
PERFORM bdc_field_idx USING 'EKPO-BPRME' mara-meins w_line_i.
PERFORM bdc_field_idx USING 'EKPO-WERKS' p_nwerks w_line_i.
PERFORM bdc_field_idx USING 'EKPO-LGORT' g_t_itab-lgort w_line_i.
IF g_t_itab-pstyp = '3'.
g_t_itab-pstyp = 'L'.
ELSE.
CLEAR g_t_itab-pstyp.
ENDIF.
PERFORM bdc_field_idx USING 'RM06E-EPSTP' g_t_itab-pstyp w_line_i.
item details screen
PERFORM bdc_dynpro USING 'SAPMM06E' '0211'.
PERFORM bdc_field USING 'BDC_OKCODE' '=OR'.
PERFORM bdc_field USING 'EKPO-SPINF' 'B'.
PERFORM bdc_field USING 'EKPO-BSTAE' '0001'.
PERFORM bdc_field USING 'EKPO-MWSKZ' g_t_itab-mwskz.
PERFORM bdc_field USING 'EKPO-IDNLF' g_t_itab-idnlf.
PERFORM bdc_field USING 'EKPO-REPOS' 'X'.
PERFORM bdc_field USING 'EKPO-EVERS' g_t_itab-evers.
PERFORM bdc_field USING 'EKPO-KZABS' 'X'.
PERFORM bdc_field USING 'EKPO-NETPR' w_price_tx. "deliberate
PERFORM bdc_field USING 'EKPO-PEINH' w_peinh_tx . "Overwriting
Source list
PERFORM bdc_dynpro USING 'SAPLMEOR' '0220'.
PERFORM bdc_field USING 'BDC_OKCODE' 'EN'.
PERFORM bdc_field USING 'BDC_CURSOR' 'EORD-AUTET(01)'.
PERFORM bdc_field USING 'EORD-VDATU(01)' '01062004'.
PERFORM bdc_field USING 'EORD-BDATU(01)' '31122999'.
PERFORM bdc_field USING 'EORD-FEBEL(01)' ' '.
PERFORM bdc_field USING 'EORD-AUTET(01)' '1'.
GOTO Conditions
PERFORM bdc_dynpro USING 'SAPMM06E' '0211'.
PERFORM bdc_field USING 'BDC_OKCODE' '=KO'.
PERFORM bdc_dynpro USING 'SAPMV13A' '0201'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BACK'.
ENDFORM. " BDC_DETAIL
*& Form BDC_FIELD_IDX
text
-->P_1390 text
-->P_G_T_ITAB_PSTYP text
-->P_W_LINE_I text
FORM bdc_field_idx USING field LIKE bdcdata-fnam
value p_index TYPE i.
DATA: w_index_tx(2).
UNPACK p_index TO w_index_tx.
CLEAR bdcdata.
CONCATENATE field '(' w_index_tx ')' INTO field.
bdcdata-fnam = field.
bdcdata-fval = value.
APPEND bdcdata.
ENDFORM. " BDC_FIELD_IDX
regards, -
What is the field and Table for "Batch Class" and "Class Type" in QM.
Hi All,
What is the field and Table for "Batch Class" and "Class Type" in QM.
Thanks,Hi,
For batch class the class type value is '023' . This you can find from KLAH table and the fileld for class type is KLART..
And also all the data related to batch class are found in tables INOB, KLAH,KKSK and for the characeteristics of batch materials you can refer AUSP table.
In INOB table, for batch class, you need to give 023 in KLART field and value MCH1 in OBTAB filed.
Please check this and let me know if this you need any more details? -
What are the most important tables in SD, MM, PP, FI , CO and QM?
Hi all,
What are the most important tables in SD, MM, PP, FI , CO and QM? i.e. most used.
Thanks,
Charles.
+++++++++++++++++<b>In FI:</b>
BKPF Accounting documents (Header)
BSEG Item level
BSID Accounting: Secondary index for customers
BSIK Accounting: Secondary index for vendors
BSIM Secondary Index, Documents for Material
BSIP Index for vendor validation of double documents
BSIS Accounting: Secondary index for G/L accounts
BSAD Accounting: Index for customers (cleared items)
BSAK Accounting: Index for vendors (cleared items)
BSAS Accounting: Index for G/L accounts (cleared items)
<b>In SD:</b>
VBAK Header data
VBAP Item data
VBPA Partners in sales order
VBKD Sales district data
VBEP Data related to line items, delivery lines
VBRK header data
VBRP Item data
LIKP Delivery header
LIPS Delivery item
VTTK Shipment header
VTTP Shipment item
VTTS Stage in transport
VTSP Stage in transport per shipment item
VTPA Shipment partners
VEKP Handling Unit - Header Table
VEPO Packing: Handling Unit Item (Contents)
<b>In MM:</b>
EKKO Purchase document
EKPO Purchase document (item level)
EKPV Shipping-Specific Data on Stock Tfr. for Purch. Doc. Item
EKET Delivery schedule
VETVG Delivery Due Index for Stock Transfer
EKES Order Acceptance/Fulfillment Confirmations
EKKN Account assignment in purchasing
EKAN Vendor address purchasing
EKPA Partner functions
EIPO Item export / import data
EINA Purchase info record (main data)
EINE Purchase info record (organisational data)
EORD Source list
EBAN Purchase requisition
EBKN Purchase Requisition Account Assignment
MKPF material document
MSEG material document (item level)
MARA Material master
MAKT Material text
MARC Material per plant / stock
MVKE Material master, sales data
MARD Storage location / stock
MSKA Sales order stock
MSPR Project stock
MARM Units of measure
MEAN International article number
PGMI Planning material
PROP Forecast parameters
MAPR Link MARC <=> PROP
MBEW Material valuation
MVER Material consumption
MLGN Material / Warehouse number
MLGT Material / Storage type
MPRP Forecast profiles
MDTB MRP table
MDKP Header data for MRP document
MLAN Tax data material master
MTQSS Material master view: QM
<b>In QM:</b>
QALS Inspection lot record
QAMB Link inspection lot - material document
QAVE Inspection usage decision
QDPS Inspection stages
QMAT Inspection type - material parameters
QINF Inspection info record (vendor - material)
QDQL Quality level
QDPS Inspection stages
<b>In PP:</b>
AUFK Production order headers
AFIH Maintenance order header
AUFM Goods movement for prod. order
AFKO Order header data PP orders
AFPO Order item
RESB Order componenten
AFVC Order operations
AFVV Quantities/dates/values in the operation
AFVU User fields of the operation
AFFL Work order sequence
AFFH PRT assignment data for the work order(routing)
JSTO Status profile
JEST Object status
AFRU Order completion confirmations -
What are the different "Setup tables" in OF?
Hi all,
what are the different "Setup tables" in OF?
SOMASIsetup is depends on the various tables, for example the key flexfield structure data stores in the fnd_flex_values and the gl segments data stores in the gl_code_combinations. You have to go through from each setup.
Srini C -
Regarding table control in BDC
Hi,
How can we handle table control in BDC,If i have the transaction like
1>having scroll bar
2>having InsertButton for the tablle control
3>Even though if we have scroll bar or Insert button(+) , is there any limit for the number of rows in table control
or can we insert as many records as we want?
If there is limit how can we identify ,what is the limit of table control.
4>How can we know for table control ,how many records are inserted for each scroll down or Insert button.
i think it varies accroding to the resolution.How can we handle this
ThanksHi Rama Krishna,
While recording the scroll bar will not be recorded.
There is no limit for the number of records,depends on configuration
say suppose the visible lines are 16 then after pressing the new-page then again 16 lines will be available which includes one of the previous lines.
the logic can be as
loop at it_tab.(say 100 records are there)
steps to be executed for table control.
I hope u know hw to capture the line no into v_no.
if v_no = 16.(visible lines)
step for new-page.
endif,
endloop.
Example :
IF V_COUNT = '13'. "Counter reached visible lines
PERFORM BDC_FIELD USING 'BDC_OKCODE' " For New Document Number
'=FDPE'.
V_COUNT = 1.
Hope this will be helpful. -
What is the concept behind using table PA0002 and structure p0002.
Hi,
What is the concept behind using table PA0002 and structure p0002.
Many times, I have seen Looping at structure e.g. p0002, p0006 etc. and data is processed and also seen Looping at table PA0002, PA0006 etc. with further appropriate subtypes if any to retrieve a value and process the same.
In which context tables like PA,HRP,IT etc. are used and structures p0001,p0002 etc. are used.
Regards,
AmeetHI,
As mentioned that that Structure Pnnnn is user as a internal tablw when a LDB is used.
Ex.
TABLES: PERNR.
INFOTYPES: 0001.
GET PERNR.
PROVIDE * FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.
WRITE: / P0001-PERNR,
P0001-STELL,
P0001-BEGDA,
P0001-ENDDA.
ENDPROVIDE.
Here it is important to declare the infotypes you want to read and so the system will create internal tables ex. P0001.
Tables PA0001 are database table with following fields
MANDT
.INCLUDE PAKEY
.INCLUDE PSHD1
.INCLUDE PS nnnn
Thanks,
Poonam. -
What is the concept of setup tables in LO extraction?
Hi,
what is the concept of set up tables in LO EXTRACTION?
GIVE ME COMPLETE DETAILS and how to run deltas? I want step by step procedure.
Thanks in advance.
ravi.Ravi,
I think the blog series by Robert Negro about LO is the best available information.
SDN thread:
/community [original link is broken]
It would be nice if there is any help.sap documentation available.
Raj. -
What are the functions of tables in ods
Hi,
what are the functions of tables in ods.
new data table
change log table
active data table.
How 0recordmode work with these 3 tables.
and how sid will work with ods?
can anyone give detailed explanation.
please do not give sap help links.
Thanks,
madhu
ThanksHi,
new table holds the "new" loaded data in ODS. If you start a new request to load data in your ODS, it firstgoes to table new data. Then you normally activate data either manually or by process chain. Then the daa will be copied over from new to active table. The change log table holds the delta information, what will change during activation or which records will be overwritten with new data or which data is new at all.
With recordmode you can specify which update mode will be used or more excalty which delta mode will be used. SID is necessary for master data, because ODS will only hold the SID values of the used characteristivcs and not the characteristic values itselfs. It's part of normalization used in BI.
For more details I recommend to look here in SDN, go to a class or read help.sap.com pages.
Regards,
Juergen -
What is the concept of view in material master?
Hello sap gurus
Some quetions regarding Material Master
what is the concept of views in material master ?
what is determined by specifying industry sector in material master ?
To sell material which views are material are maintened in Material master?
Regards
AmitHi,
<b>Material master for finished ggods is related with SD, MM & PP departments</b>. If you carefully go through the various screens in MM record you will realize the importance of the respective fields and the department to which they belong.
<b>1.Suppose Base unit of measure</b> in Basic data 1 screen. The production people will keep the stock of the item using this UOM.
<b>2. In Sales:Sales Org.1</b> screen we have sales unit in which we will sell the material.
<b>3. Then we have the plant</b> data in which we enter the delivering plant. Also the taxes are determined from the plant so we have the settings for taxes also - whether this material is fully taxable/50% tax/Tax exempted.
<b>4. Then we have purchasing</b> screen in which the data like the purchasing group, variable units,etc are entered. This will effect the purchasing cycle when we are procuring a material from outside. This is related to MM.
<b>5. The we have MRP</b>, this is related to PP as to how to manufacture the product, the MRP type, the strategy group - whether it is MTO/MTS like that.
<b>5. Sales:Sales Org.2 screen</b> - Here we mainatin the account assignment group which is very important as far as the generation of the accounting document is concerned. This triggers the system where to post the value in which G/L account. Accounting document is generated when we create the invoice in VF01 & save it.
<b>6. Work scheduling</b> - Related with the sceduling of the production as to whether underdelivery or overdelivery is allowed, the storage location
<b>7. Quality</b> - Here you can select for a particular finished item where where it has to be checked for quality during its journey from the raw material stage to the finished goods store as a finished item.
<b>8. Accounting</b> - Related to accounting, product costing, total value of the stock in hand, etc. Also related with FI & PP
So all the screens have data which effects one or more modules for the proper functioning of the system to give the optimum results.
<b>Industry Sector:</b>
Key that specifies the branch of industry to which the material is assigned.
<b>Use</b>
When you create a material master record, the industry sector you specify determines
1. which screens appear and in what order
2. which industry-specific fields appear on the individual screens
<b>Screens for Sales:</b>
Sales:Sales Org.1, Sales:Sales Org.2. But other screens also have data which is related to sales. You cannot just maintain the sales views and save the master. It has to be properly linked with the other modules also for the proper functioning of the system. That is why the system is called as "Enterprise Resource Planning" You have to paln the resources of your company and these resources are related with all the modules.
Reward points if solution helps.
Regards,
Allabaqsh G. Patil
Maybe you are looking for
-
Network based and a-gps, data use tests
i was trying to find this kind of info, but only found others asking. i hope this is useful info for others, especially while roaming. skip to the bottom for conclusion, this is the process i took: i called nokia tech support, their phone support his
-
So i bought 2 blackberrys Curve's from ebay, cant seem too get them working on internet, bbm etc, been told i need a blackberry internet service, problem is i'm on a three contract simcard and dont seem too know if its possible and how, and if i do g
-
How to Load 100 Million Rows in Partioned Table
Dear all, I a workling in VLDB application. I have a Table with 5 columns For ex- A,B,C,D,DATE_TIME I CREATED THE RANGE (DAILY) PARTIONED TABLE ON COLUMN (DATE_TIME). AS WELL CREATED NUMBER OF INDEX FOR EX, INDEX ON A COMPOSITE INDEX ON DATE_TIME,B,C
-
The arrows for my type tool controlling the size are locked out.
This occurred all of a sudden. How can I fix this? I can work around it, but would like to know why this happened and if it can be fixed.
-
What should I do BEFORE formatting?
Hi, I'm about to take the long road of formatting my PC soon (it´s starting to show different signs of unhappines). I have an iPod Touch and iTunes with ~32GB of music, mostly ripped CD:s (my own, paid for, CD:s. I'm that old ) but also some music bo