Selection view in MM02 BDC program
Hi Experts,
I am doing BDC Session method for Tcode MM02.There i am getting selection View screen for different material.But if i select a material in Sales view i need to select Sales :Sales org dAta.
It's coming third position.
But for some material it's coming fourth view.
If i record bdc in third position it'll take third view some other. how i can select the view in selection view.
Please,Anybody knows give me the suggestion.
Thanks & Regards,
Nandha
Hi,
use this Function module <b>SELECTION_VIEWS_FIND</b> to find the view position.
This One of functional modules for those who still has to use BDC for Material Master transactions (MM01 and MM02). Allows to determine line number for desired view in the "Select View(s)" window, to prepare BDC for the view access
Find the positon of the View based on this function module and write the code to select that perticular view.
Hope this solves your problem
Thanks
Sudheer
Similar Messages
-
Hi Experts,
I am doing BDC Session method for Tcode MM02.There i am getting selection View screen for different material.But if i select a material in Sales view i need to select Sales :Sales org dAta.
It's coming third position.
But for some material it's coming fourth view.
If i record bdc in third position it'll take third view some other. how i can select the view in selection view.
Please,Anybody knows give me the suggestion.
Thanks & Regards,
NandhaHi Experts,
I am doing BDC Session method for Tcode MM02.There i am getting selection View screen for different material.But if i select a material in Sales view i need to select Sales :Sales org dAta.
It's coming third position.
But for some material it's coming fourth view.
If i record bdc in third position it'll take third view some other. how i can select the view in selection view.
Please,Anybody knows give me the suggestion.
Thanks & Regards,
Nandha -
Auto select u201CView selection only on requestu201D in selection view screen-MM02
HI Friends,
I want to auto set u201CView selection only on requestu201D in selection view screen before entering into various views (Basic data 1 / Basic data 2 . . .etc) for t.code- MM02 for all users. Please let me know where needs to be set.
Thanks in advance.
RAMAN.Hi
Please go to SM30 and enter the table USRM1. There you can control the user departments for the users and check the required filed " View selection on request" field name : -ASCHL.
Hope this helps your requirement.
Regards,
Sunil.K -
Hi,
I would just like to ask if there is an easier way to get the selection views in MM02. There are different views per material and I need to insert the logic in getting the view to a custom program. The custom program will be used for performing a BDC transaction that's why I need to get the logic for the views.Hi
Try using the function module SELECTION_VIEWS_FIND
* Material views ....................................................
data: l_vpsta like t130m-pstat.
select single vpsta
into l_vpsta
from mara
where matnr = p_matnr.
* Get View sequence .................................................
data: l_bild like t133a-bilds,
lt_bild like mbildtab occurs 0 with header line.
* Screen Sequence for Standard Industry tab pages in material master
l_bild = '21'.
* Get screen sequence
call function 'SELECTION_VIEWS_FIND'
exporting
bildsequenz = l_bild
pflegestatus = l_vpsta
tables
bildtab = lt_bild
exceptions
call_wrong = 1
empty_selection = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
Shiva -
Select Accounting View in BDC Program
Hi Experts,
I am working on a BDC program in which I have to change the Accounting view data for Materials(MM02).
Each material has diferent number of views. So How can I select only the Accounting View when changing Material data through BDC.
Thanks
KumarHi ashok ,
ideally you should use BAPI_Material_savedata to change the material master.
as far as your problem goes you can use the following method to select appropraite view in MM02.
SET PARAMETER ID 'MXX' FIELD c_v.
c_v is a char 1 constant and can have values
User department Maintenance statu(Value of c_v)
Work scheduling A
Accounting B
Classification C
MRP D
Purchasing E
Production resources/tools F
Costing G
Basic data K
Storage L
Forecasting P
Quality management Q
Warehouse management S
Sales V
Plant stocks X
Storage location stocks Z
Regards,
N.
Edited by: navjot sharma on May 26, 2008 2:02 PM -
Problem in BDC for selecting the QM View in MM02
Hi,
I am facing a problem that when the material is entered select view screen opens and the positioning of QM view is 11 or 13 sometimes. i want the processing should of QM should be irespective of position.
report ZBDC_MM02_QM_VIEW
no standard page heading line-size 255.
include bdcrecx1.
data: begin of record OCCURS 0,
MATNR_001(018),
WERKS_002(004),
ART_003(008),
APA_004(001),
AKTIV_005(001),
end of record.
PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.
initialization.
CTUMODE = 'A'.
CUPDATE = 'A'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
MASK = ',.'
MODE = 'O'
IMPORTING
FILENAME = P_FILNAM
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILNAM
FILETYPE = 'DAT'
TABLES
DATA_TAB = RECORD
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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT RECORD.
ON CHANGE OF RECORD-MATNR_001.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
record-MATNR_001.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(11)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(11)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
record-WERKS_002.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=PB01'.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-ARGUMENT'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_field using 'RMQAM-INSMK'
'X'.
perform bdc_field using 'RMQAM-QKZVERF'
'06'.
perform bdc_field using 'RMQAM-PPL'
'X'.
perform bdc_field using 'RMQAM-APP'
'X'.
perform bdc_field using 'RMQAM-DYN'
'X'.
perform bdc_field using 'RMQAM-MER'
'X'.
perform bdc_field using 'RMQAM-AVE'
'X'.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-AKTIV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=WEIT'.
perform bdc_field using 'RMQAM-ART(01)'
record-ART_003.
perform bdc_field using 'RMQAM-AKTIV(01)'
'X'.
perform bdc_transaction using 'MM02'.
ENDON.
ENDLOOP.Hi,
Use following code
CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'
EXPORTING
MATERIAL = IT_UPLOAD-MATNR " Material number
MATERIALART = GI_MARA-MTART " Material Type
SELECTION = 'Q' " PSTAT(maintenance status) value for Quality Managemant.
TCODE = 'MM01' " Tcode where view's are called.
TABLES
BTCI_D0070 = IT_BDCDATA_VIEW
EXCEPTIONS
MATERIAL_NOT_FOUND = 1
MATERIAL_NUMBER_MISSING = 2
MATERIAL_TYPE_MISSING = 3
MATERIAL_TYPE_NOT_FOUND = 4
NO_ACTIVE_DYNPRO_SELECTED = 5
NO_AUTHORITY = 6
OTHERS = 7.
READ TABLE IT_BDCDATA_VIEW WITH KEY FVAL = 'X'.
IF SY-SUBRC = 0.
V_SELECTION = IT_BDCDATA_VIEW-FNAM.
VAR = IT_BDCDATA_VIEW-FNAM+17(2).
IF VAR > '17'.
VAR = VAR - 17.
IF VAR NE '2'.
CONCATENATE '0' VAR INTO VAR.
ENDIF.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0070'.
CONCATENATE 'MSICHTAUSW-DYTXT(' VAR ')' INTO VAR1.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
VAR1.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
CLEAR VAR1.
CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1.
PERFORM BDC_FIELD USING VAR1
'X'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
IF VAR < '17'.
CONCATENATE 'MSICHTAUSW-DYTXT(' VAR ')' INTO VAR1.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
VAR1.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
CLEAR VAR1.
CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1.
PERFORM BDC_FIELD USING VAR1
'X'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
Regards,
Pritish -
How to find the position of view in MM02 transaction for coding BDC?
Hi Guys,
Is there any FM or BAPI Available to find the position of the view in MM02 transaction. I tried FM SELECTION_VIEWS_FIND. But getting inconsistent results
i.e Some materials it is giving correct positions but for others i am getting wrong position. So my BDC is getting failed.
Thanks in advance.
Vinod.Hi,
data : i_t133a like t133a occurs 0 with header line,
ch(1),
viewno(2) type n.
clear viewno.
select * from t133a into corresponding fields of table i_t133a
where bilds = '21' and guifu like 'SP%' .
loop at i_t133a .
ch = i_t133a-pstat.
if mara-vpsta na ch .
delete i_t133a .
continue .
endif .
endloop.
sort i_t133a by guifu ascending .
loop at i_t133a .
viewno = viewno + 1 .
if i_t133a-guifu = 'SP01'. "FOR BASIC DATA1 CHANGES ACCORDINGLY REFER TABLE T133A TO FIND VTHE VALUE
exit .
endif .
endloop .
reward if usefull -
Problem in mm02 for select view
Hi
get points and give me solution.
Gurus
I m creating one bdc for tcode mm02 ,in this bdc i want to select only one view
QUALITY MANAGMENT but when i run bdc ,bdc select another view that r not
required . In our select view list required QUALITY MANAGMENT comes
after scrolling 3 times. so plz provide me solution .when u rcording u will get a screen no , before scrolling to next page for views.
press page down once , press enter
press page down second time , press enter
press page down third time , press enter
select your required view .
after record completion ,
insert the screen no statement perform ,,,,,,,
before every page down ( for view )statement in your bdc report .
rgds
Chalam -
MM02 Select View option releated
I would like to confirm my understanding regarding MM02 Select View popup screen where we get list of views like Basic data1, MRP 1, etc.
Is this views are only controlled in OMS2 and OMT3E for one particular material type?
Is there anyway where we can restrict these number of views to any specific user, if this can be done how these can be restricted?
Thank you very much
Regards,
ArvindHi,
1) control though spro
You can control the view through Logistics general--> Material master >Configuring material master> User setting.
Here you can select the User name & then select the view selection--> list of screen.
you can select the which you want control
2) better control form authorization object
restrict by authorization object:
M_MATE_STA ( for particular view authorization )
M_MATE_MAR with ( for particular material type authorization) -
Hi to all
I'm new to BDC Progaram
can u tell me how to write a
BDC program to upload purchase order data from legacy system.Hi Viswanath,
First i will explain the procedure step by step and will send a sample code plz check it once ok..And also i will attach a flat file at the end of SAMPLE CODE CHECK IT ONCE OK..
Steps:
1.Bulid an internal table first according to ur flat file fields.
2.select the flat file by using PARAMETER.
3.And assign that file path to GUI_UPLOAD function module.
4.Call BDC_OPEN_GROUP is used to open the session.
5.loop that flat file data and palce BDC_INSERT funtion module in that loop for uploading data into database table
6.After loop call BDC_CLOSE_GROUP to close the session.
SAMPLE CODE:
REPORT ybdc_session_mm01 NO STANDARD PAGE HEADING LINE-SIZE 255.
Global Structure for BDC Data
DATA: it_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Internal Table
DATA: BEGIN OF itab OCCURS 0,
mbrsh LIKE rmmg1-mbrsh,
mtart LIKE rmmg1-mtart,
maktx LIKE makt-maktx,
meins LIKE mara-meins,
END OF itab.
Upload the flat file
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename =
'C:\Documents and Settings\Compaq_Owner\Desktop\satish\mm01.txt'
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab.
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Session Method Starts
BDC_OPEN_GROUP
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
DEST = FILLER8
GROUP = 'ychinnu'
HOLDDATE = FILLER8
KEEP = 'X'
USER = SY-UNAME
RECORD = FILLER1
PROG = SY-CPROG
IMPORTING
QID =
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Create BDCDATA Structure
*include bdcrecx1.
START-OF-SELECTION.
PERFORM open_group.
loop at itab.
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MTART'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MBRSH'
itab-mbrsh.
PERFORM bdc_field USING 'RMMG1-MTART'
itab-mtart.
After enterning MBRSH,MTART we press enter
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'. "press Enter
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
View selection (Basic data1)
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'"view selection
'X'.
Select Tick Mark (ok)
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'MAKT-MAKTX'
itab-maktx.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARA-MEINS'.
PERFORM bdc_field USING 'MARA-MEINS'
itab-meins.
Finally after filling the data we save the data.
PERFORM bdc_field USING 'MARA-MTPOS_MARA' "For saving
'NORM'.
PERFORM bdc_transaction USING 'MM01'.
PERFORM close_group.
BDC_INSERT
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MM01'
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
SIMUBATCH = ' '
CTUPARAMS = ' '
TABLES
dynprotab = it_bdcdata
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 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.
Refresh BDCDATA
refresh it_bdcdata.
endloop.
Closing BDC Group
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Start new screen *
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. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF FVAL NODATA.
CLEAR it_bdcdata.
it_bdcdata-fnam = fnam.
it_bdcdata-fval = fval.
APPEND it_bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
Flat File
*M FERT IRON KG
*M ROH STEEL KG
*M HALB IRON KG
Award points if helpful.
Kiran Kumar.G.A -
How to overcome view changes in bdc session method using recording ?
how to overcome view changes in bdc session method using recording ?
ex-for mm01 in recording if i selected views basic data1 and basic data2.
i seheduleded for background for after 3 days .
if any body changes views by selecting other views also.
how to overcome this with out programming ?
is there any settings ?Hi,
I am attaching few threads.Hope these will help you.
If there are any error records in session, all those error records will get poulated in log .SM35 and after the session is completed , u can see error records which can be corrected and reprocessed again
We have the structures BDCLD and BDCLM, which will capture the log details inthe session. Firstly, sesssion should be processed. After that log will be created. Then caputure the information into an internal table using BDCLM and BDCLD.
and refer the link.
error correction in bdc session
regards
Madhu -
Dynamic select views for MM01 Transaction
Hii Friends,
I have an issue like i need to dynamically select the views in MM01 transaction from the BDC program
without selecting that views manually.
Using SHDB recording i can select the views before recording and then call those views again
If i want to select the views from the program how do i do it..
If there is any way to do this in call transaction let me know plz
Thanks in advance
kishoreBDC is not good for MM01 , go for bapi
other wise go for LSMW bapi method...
Business Object BUS1001006 Standard material
Method SAVEDATA Create and change materia
Message Type MATMAS_BAPI Create and change materia
Basic Type MATMAS_BAPI02 Create and Change Materia -
Hi ,
can anyone pls give a program for MM02 BDC and in that only selecting forecast screen and given forecast values.
THXHi
Go through the link given below for the program of MM02.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/sample%2bbdc%2bprogram%2bfor%2bmm02
With Regards
Nikunj Shah -
Changes in BDC program to upload data from text/excel file
Hi friends i have obtained the BDc program after recording :
start-of-selection.
perform open_group.
perform bdc_dynpro using 'SAPLCOIH' '0100'.
perform bdc_field using 'BDC_CURSOR'
'CAUFVD-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'AUFPAR-PM_AUFART'
'PM01'.
perform bdc_field using 'CAUFVD-IWERK'
'460a'.
perform bdc_field using 'CAUFVD-GSBER'
'2460'.
perform bdc_field using 'CAUFVD-EQUNR'
'10000009'.
perform bdc_dynpro using 'SAPLCOIH' '3000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'CAUFVD-KTEXT'
'abc'.
perform bdc_field using 'CAUFVD-INGPR'
'GM'.
perform bdc_field using 'CAUFVD-VAPLZ'
'RTN_VELR'.
perform bdc_field using 'CAUFVD-VAWRK'
'460A'.
perform bdc_field using 'BDC_CURSOR'
'CAUFVD-GLTRP'.
perform bdc_field using 'CAUFVD-GSTRP'
'1.8.2010'.
perform bdc_field using 'CAUFVD-GLTRP'
'1.8.2010'.
perform bdc_field using 'CAUFVD-TPLNR'
'RTNP-HIG'.
perform bdc_field using 'CAUFVD-EQUNR'
'10000009'.
perform bdc_field using 'AFVGD-INDET'
'1'.
perform bdc_field using 'AFVGD-WERKS'
'460A'.
perform bdc_field using 'AFVGD-STEUS'
'PMIN'.
perform bdc_field using 'AFVGD-ARBEH'
'H'.
perform bdc_field using 'AFVGD-DAUNE'
'H'.
perform bdc_dynpro using 'SAPLCOIH' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'CAUFVD-KTEXT'.
perform bdc_field using 'CAUFVD-KTEXT'
'abc'.
perform bdc_field using 'CAUFVD-INGPR'
'GM'.
perform bdc_field using 'CAUFVD-VAPLZ'
'RTN_VELR'.
perform bdc_field using 'CAUFVD-VAWRK'
'460A'.
perform bdc_field using 'CAUFVD-GSTRP'
'01.08.2010'.
perform bdc_field using 'CAUFVD-GLTRP'
'01.08.2010'.
perform bdc_field using 'CAUFVD-TPLNR'
'RTNP-HIG'.
perform bdc_field using 'CAUFVD-EQUNR'
'10000009'.
perform bdc_field using 'AFVGD-LTXA1'
'abc'.
perform bdc_field using 'AFVGD-INDET'
'1'.
perform bdc_field using 'AFVGD-ARBPL'
'RTN_VELR'.
perform bdc_field using 'AFVGD-WERKS'
'460A'.
perform bdc_field using 'AFVGD-STEUS'
'PMIN'.
perform bdc_field using 'AFVGD-ARBEH'
'H'.
perform bdc_field using 'AFVGD-DAUNE'
'H'.
perform bdc_transaction using 'IW31'.
perform close_group.
after executing it has two options.one is for call transactioin and other is for with session.Now i want to do the uploading from text file.Please guide me how to achieve that and what should be the order of fields in the text file.I am just a beginner.I know how to do that with LSMW bt trying BDc first time for creating PM ordersYou can use class "cl_gui_frontend_services". First you must select file with "file_open_dialog" method and the you can upload file with "gui_upload" method into internal table. Here is a sample: (I didn't try the code but I'm sure you can get it working, there are lots of sample codes about that. You can also search FM "GUI_UPLOAD").
REPORT zreport.
DATA:
gv_subrc TYPE sysubrc,
gv_result TYPE abap_bool,
gt_data_tab type table of zstruc.
PARAMETERS: p_fname LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM file_open_dialog USING space space space space
CHANGING p_fname gv_action gv_subrc.
START-OF-SELECTION.
PERFORM gui_upload TABLES gt_data_tab
USING p_fname CHANGING gv_subrc.
*** FORMS ***
FORM file_open_dialog USING pv_window_title
pv_default_extension
pv_default_filename
pv_initial_directory
CHANGING pv_filename
pv_user_action
pv_subrc.
DATA:
lt_file_table TYPE filetable,
lv_rc TYPE i,
lv_initial_directory TYPE string.
IF pv_initial_directory IS INITIAL.
PERFORM get_desktop_directory CHANGING lv_initial_directory.
ELSE.
lv_initial_directory = pv_initial_directory.
ENDIF.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = pv_window_title
default_extension = pv_default_extension
default_filename = pv_default_filename
* file_filter =
* with_encoding =
initial_directory = lv_initial_directory
* multiselection =
CHANGING
file_table = lt_file_table
rc = lv_rc
user_action = pv_user_action
* file_encoding =
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5
pv_subrc = sy-subrc.
IF pv_subrc EQ 0.
READ TABLE lt_file_table INTO pv_filename INDEX 1.
ENDIF.
ENDFORM.
FORM gui_upload TABLES pt_data_tab
USING pv_filename
CHANGING pv_subrc TYPE sysubrc.
DATA:
lt_data_tab TYPE TABLE OF string,
lv_filename TYPE string.
lv_filename = pv_filename.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = lv_filename
filetype = 'ASC'
has_field_separator = 'X'
* header_length = 0
* read_by_line = 'X'
* dat_mode = SPACE
* codepage = SPACE
* ignore_cerr = ABAP_TRUE
* replacement = '#'
* virus_scan_profile =
* show_transfer_status = 'X'
* IMPORTING
* filelength =
* header =
CHANGING
data_tab = lt_data_tab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19
pv_subrc = sy-subrc.
IF pv_subrc EQ 0.
pt_data_tab[] = lt_data_tab[].
ENDIF.
ENDFORM. -
Questions on BDC program statements.....
Hi,
Currently i am checking below BDC program for packing material use.
But there is a statement that i am not very clear what it is for...
PERFORM bdc_field USING 'BDC_CURSOR'
'V51VE-EXIDV(01)'.
For the 'V51VE-EXIDV(01)', here why need to add an (01) at the end. What does the (01) means??
Thanks!!!!
LOOP AT i_lips.
CLEAR: i_bdc_tab,i_msg_tab.
REFRESH: i_bdc_tab,i_msg_tab.
PERFORM bdc_dynpro USING 'SAPMV50A' '4004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LIKP-VBELN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LIKP-VBELN'
i_lips-vbeln.
PERFORM bdc_dynpro USING 'SAPMV50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VERP_T'.
*perform bdc_field using 'LIKP-BLDAT'
* record-BLDAT_002.
PERFORM bdc_field USING 'BDC_CURSOR'
'LIPS-POSNR(01)'.
*perform bdc_field using 'LIKP-WADAT'
* record-WADAT_003.
*perform bdc_field using 'LIKP-WAUHR'
* record-WAUHR_004.
*perform bdc_field using 'LIKP-BTGEW'
* record-BTGEW_005.
*perform bdc_field using 'LIKP-GEWEI'
* record-GEWEI_006.
PERFORM bdc_dynpro USING 'SAPLV51G' '6000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'BDC_CURSOR'
'V51VE-VHILM(01)'.
PERFORM bdc_field USING 'V51VE-VHILM(01)'
'BOX'.
*Select all materails
PERFORM bdc_dynpro USING 'SAPLV51G' '6000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=HU_MARKA'.
*Select all Boxes
PERFORM bdc_dynpro USING 'SAPLV51G' '6000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=HUMARKHU'.
*perform bdc_field using 'V51VE-SELKZ(01)'
* record-SELKZ_01_008.
PERFORM bdc_dynpro USING 'SAPLV51G' '6000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=HU_VERP'.
PERFORM bdc_field USING 'BDC_CURSOR'
'V51VE-EXIDV(01)'.
PERFORM bdc_dynpro USING 'SAPLV51G' '6000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
PERFORM bdc_field USING 'BDC_CURSOR'
'V51VE-EXIDV(01)'.
CALL TRANSACTION 'VL02N' USING i_bdc_tab
MODE p_mode
MESSAGES INTO i_msg_tab.
Message was edited by:
Hoo LaaAnd if this is a BDC running in background, or a call transaction, then placing the cursor on a given field has no effect unless it is needed for navigation to the next screen.
When you record a BDC using SHDB there are a lot of statements like this that are added in but are not needed for the BDC to work.
Another example is the "BDC_SUBSCR" field name - this does not in most cases appear to have any effect on how the BDC is processed.
Also, the recording will include fields which have default values on the screen that you do not need to overwrite with the same value from the BDC.
I often delete these statements from the recording, taking care that I understand what the impact is. You can try commenting out the line and see what difference it makes to processing.
When using a BDC for updating a lot of records, having less of these types of lines in the BDCDATA table will speed performance a bit.
Andrew
Maybe you are looking for
-
Hi, Expert My client wants to make payment directly to payable A/c like Salary payable/service tax payable/tds payable how its possible, what is the way to solve the problem regards gk
-
GL Balance upload using LSMW (BAPI bus6035)
Hello everyone, We are uploading GL balances from legacy to SAP using the LSMW Bapi object - bus6035 method - post message type - ACC_DOCUMENT Basic type - ACC_DOCUMENT03 When we run the lsmw, idoc is created, however with an error 51 saying "Functio
-
EVENT_SORT for table control
Hello, the built-in sort popup of a table control is quite convenient, allowing to sort columns without any programming However, imho it would be useful to allow notifying the program of such a sort event. It appears though, that the EVENT_SORT is av
-
I'm trying to reset my security questions but I don't know what email it's sending to
It won't let me download music off my phone till I answer my security questions but I forgot them. I tried resetting them but the email is sending to an email that isn't mine. I don't know what to do.
-
Graphic animation and texture technique
Hello Adobe, I'm wanting mock this graphic within after effects and wondering how I can get this same animation and texture effect from solids or shape layers? Watch video below (5s). WIN Television - PRG [2014] - YouTube Thank you.