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
Similar Messages
-
Problem in BDC for Material master Change
Hi,
I have made a BDC to change the material master, I have done the recording with SHDB I want to do changes in Sales data and MRP data, when I do the recording I have selected views and it was 4 , 11 AND 12 VIEW IN select vie option but in some material Classifcation view is maitain and it is coming at 2nd position and my selected views are shiftin by one position due to this BDC is giving error Screen contain no filed -
I sthere any way that I acn directly select the Three views as Sales data , MRP1 and MRP2, because when we do the recording it is not showing the name it is showing as
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(12)'.
perform bdc_field using 'BDC_OKCODE'
'=DEF_SAVE'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(11)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)'
'X'.
regards,
zafarHi,
Myproblem is solve , in the table MARA i found the filed VPSTA : Maitenance status, Having the vakue may KVEDLBZX those value is diffrent for different material this value indicates
User department Maintenance status
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,
after reading what fields are maitain according to that i have selected the proper views and my problem is solve.
regards,
zafar -
Print program for the smartform for selecting the output type (email/fax)
Hi All,
Requirement :I have to create a print program for the smartform where the output type may be print out,email or fax ,so i need to put the condition for selecting the output type (like printout,email,fax).
can any body please let me know how to put the condition for selecting the desired output type ?
Thanks in advance
RahulHi
It is not the output type that has to be changed
it is the MEDIUM which you have to change and configure
for printout medium is 1
for FAX medium is 2
for MAIL it is 7.
so instead of printout change the medium to 2 or 7 for the same output type and attach to the same driver program and smartform/form.
Reward points for useful Answers
Regards
Anji -
Query for selecting the 4 highest marks of the student
query for selecting the 4 highest marks of the student
Guys dont start an argument,
tey this one; please
Hi,
Try this
Top 4
Select ename,
sale
From dept d,
emp e1
Where d.deptno = e1.deptno
And &p > (Select Count(e2.sal)
From emp e2
Where e2.sal > e1.sal
And e2.deptno = e1.deptno
Order By 1,2
Bottom 4
Select ename,
sale
From dept d,
emp e1
Where d.deptno = e1.deptno
And &p > (Select Count(e2.sal)
From emp e2
Where e2.sal < e1.sal
And e2.deptno = e1.deptno
Order By 1, 2
&P you use any value say 3,4,5,6
This is top N analysis
Regards
Umesh -
A problem with PoE devices in the Topology view (LMS 3.1)
Hello,
the customer has a problem with PoE devices in the Topology View. :-( He doesn't see the 2960 PoE devices with the PoE filter enabled in the topology view:-( He uses LMS 3.1 on Windows.
In the NetPro discussion I found that the list of PoE devices is in the following file:
POECapableDeviceTypes.properties
but I cann't to find thid file in the campus directory. In the campus folder are following folders: bin, etc, lib and www.
Thank you
RomanThe file is in NMSROOT/campus/www/classpath/com/cisco/nm/ani/clients/campus/main/filters/POECapableDeviceTypes.properties.
-
Select a specific view in MM02/MM01
Hi Abappers,
I am doing a BDC on MM01 transaction and want to just select the accounting view and extend materials for different valuation types. But the position of accounting view is coming different on different material and my BDC recording is failing to select the accounting view. Does anyone has any idea how we can pinpoint and select the accounting view?
Thanks,
David.SELECTION_VIEWS_FIND - This FM Will work depends on material type..
in your case this FM Is not required and you need to have Accounting view.
Any way See below program and you will get some idea and uploaded data into Material master change mode and it is applicable to user defined view
REPORT zjpmuim306 NO STANDARD PAGE HEADING LINE-SIZE 250 MESSAGE-ID
zjpm001.
*& I N B O U N D V I A A B A P : Batch input Session method *
*& Development ID: IM_DD_306_LJP *
*& Report : ZJPMUIM306 *
*& The Purpose of the Object is to interface Create Input Record *
*& for SAP Migration from the Material master of BPCS All the *
*& information received at BPCS is collected into a single record. *
*& By using session method upload data from file ,one item is
*& created for one record *
*& Change Log: *
*& Init Who Date Text *
*& MALIKDH1 Seshu Reddy 26-07-2003 Initial Version *
Constants *
CONSTANTS:c_vkorg(4) type c value 'JP20', " Sales Organization
c_vtweg(2) type c value 'TR' , " Distribution Channel
c_werks(4) Type c value 'JP01' , " Plant
c_viewlist(15) VALUE 'KDEALBSZXVPCFQG'," View list
c_scm_view TYPE msichtausw-dytxt VALUE 'SCM View',
c_sd_view TYPE msichtausw-dytxt VALUE 'SD View',
c_seq_code(2) VALUE 'Z1', " Sequential Code
c_keep(1) TYPE c VALUE 'X', " Keep
c_group LIKE apqi-groupid VALUE 'IM306', " Session Name
c_tcode LIKE tstc-tcode VALUE 'MM02', " Transaction Code
c_blank(1) VALUE ' ', " Blank
c_intls(1) VALUE 'N'. " Logistic Status
Variables *
DATA: g_flag1(1), " Variable to hold
g_flag(1), " Variable to hold
g_file LIKE rlgrap-filename VALUE
'C:\Documents and Settings\seshur\Desktop\HCLT123.CSV'. " File name
Internal tables/ Work area *
Internal Table for Delimter
DATA : BEGIN OF t_delim OCCURS 0,
text(1000),
END OF t_delim.
Internal table for BDC processing
DATA : t_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Internal table for holding the data which has to be uploaded.
DATA: BEGIN OF t_bpcs OCCURS 0,
matnr(15) TYPE c, " material no
dosage(40) TYPE c, " Dosage form(Local)
appearance(40) TYPE c, " Appearance
idcode(6) TYPE c, " Identification Code
prostformno(10) TYPE c, "SOP
weitab(7) TYPE c, " Weight/tablet
uom1(2) TYPE c, " UOM of Carton
uom2(2) TYPE c, " UOM of Case
carsize(14) TYPE c, " Carton size
cassize(14) TYPE c, " Case size
rupqty(11) TYPE c, " Round up
abvname(3) TYPE c, " Product short name
END OF t_bpcs.
*Internal table for t_bpcs
DATA: BEGIN OF t_mdata OCCURS 0,
matnr LIKE marc-matnr, " Material number
zzjp_dos_frm LIKE marc-zzjp_dos_frm, " Dosage form(Local)
zzjp_aprn LIKE marc-zzjp_aprn, " Appearance
zzjp_con_id LIKE marc-zzjp_con_id," Identification Code
zzjp_nyu_sop LIKE marc-zzjp_nyu_sop,"SOP
zzjp_wei_tab(10) type c , " Weight/tablet
zzjp_bio LIKE marc-zzjp_bio,"Biologics Indicator
zzjp_itf LIKE marc-zzjp_itf, " ITF code
zzjp_car(2) type c, " UOM of Carton
zzjp_cas(2) type c, " UOM of Case
zzjp_car_size(11) type c," Carton size
zzjp_cas_size(11) type c, " Case size
zzjp_rupqty(11) type c, " Round up
zzjp_init_ls LIKE marc-zzjp_init_ls, " Logistic Status
zzjp_re1 LIKE marc-zzjp_re1, "Document type(Local)
zzjp_re2 LIKE marc-zzjp_re2, "Report type
zzjp_re3 LIKE marc-zzjp_re3, "Shipping report type
zzjp_pro_id LIKE mvke-zzjp_pro_id," Product output sequence
zzjp_bu_id LIKE mvke-zzjp_bu_id, " Business unit indicator
zzjp_abv_name LIKE mvke-zzjp_abv_name," Product short name
zzjp_abv_id1 LIKE mvke-zzjp_abv_id1," Product short name output
zzjp_abv_id2 LIKE mvke-zzjp_abv_id2," Product short name internal
zzjp_spl_id LIKE mvke-zzjp_spl_id, " Sample internal order
END OF t_mdata.
Internal table for Mara Table
DATA: BEGIN OF t_mara OCCURS 0,
matnr LIKE mara-matnr, " material Number
vpsta LIKE mara-vpsta, " Maintenance status of complete material
pstat like mara-pstat, " Maintenance status
END OF t_mara.
Internal table for Material Master View Selection Screens
DATA: BEGIN OF t_bildtab OCCURS 0.
INCLUDE STRUCTURE mbildtab.
DATA: END OF t_bildtab.
internal table for T_bildtab
DATA: t_bildtab_dup LIKE t_bildtab OCCURS 0 WITH HEADER LINE.
*Work area for T_bildtab internal table(Views Selection)
DATA: BEGIN OF w_data,
flag1 type c,
anzd70 TYPE i,
field1(20) type c,
field2(20) type c,
field3(20) type c,
field4(20) type c,
count(2) TYPE c,
END OF w_data.
Main Processing *
START-OF-SELECTION.
Store data from file into internal table
PERFORM f_uplaod_data.
Transfer the uploaded data into t_mdata internal Table
PERFORM f_process_data.
Selecting The views based on Material number
PERFORM f_view_list.
Open a BDC Session
PERFORM f_bdc_open.
*Selecting the fields from mara table
SELECT matnr
vpsta
pstat
FROM mara
INTO TABLE t_mara
FOR ALL ENTRIES IN t_mdata
WHERE matnr = t_mdata-matnr.
SORT t_mara BY matnr.
SORT t_mdata BY matnr.
Transfer the uploaded data into BDCDATA structure
PERFORM f_process_bdc.
Close The BDC Session
PERFORM f_close_group.
*& Form F_VIEW_LIST *
Routine to used for Calling the function module *
Selection_views_find *
FORM f_view_list.
CALL FUNCTION 'SELECTION_VIEWS_FIND'
EXPORTING
bildsequenz = c_seq_code
pflegestatus = c_viewlist
TABLES
bildtab = t_bildtab
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.
ENDFORM. " F_VIEW_LIST
*& Form f612_view_sort *
Routine to used for Selecting The views based on Material Number *
FORM f612_view_sort.
t_bildtab_dup[] = t_bildtab[].
Reading the Internal table t_mara
READ TABLE t_mara WITH KEY matnr = t_mdata-matnr.
TRANSLATE t_mara-pstat USING ' $'.
CLEAR: w_data-flag1, w_data-anzd70.
LOOP AT t_bildtab_dup.
IF t_bildtab_dup-pstat CA t_mara-pstat.
w_data-anzd70 = w_data-anzd70 + 1.
IF t_bildtab_dup-kzanz IS INITIAL.
t_bildtab_dup-kzanz = 'X'.
w_data-flag1 = 'X'.
MODIFY t_bildtab_dup.
ENDIF.
ELSE.
IF NOT t_bildtab_dup-kzanz IS INITIAL.
CLEAR t_bildtab_dup-kzanz.
w_data-flag1 = 'X'.
MODIFY t_bildtab_dup.
ENDIF.
ENDIF.
ENDLOOP.
TRANSLATE t_mara-pstat USING '$ '.
IF NOT w_data-flag1 IS INITIAL.
SORT t_bildtab_dup BY kzanz DESCENDING idxbd ASCENDING.
ENDIF.
*Reading The internal table for T_bildtab_dup
READ TABLE t_bildtab_dup WITH KEY dytxt = c_scm_view.
IF t_bildtab_dup-kzanz = 'X'.
WRITE sy-tabix TO w_data-count.
w_data-count = w_data-count + 2.
IF w_data-anzd70 > 18.
w_data-count = w_data-count - 18.
ENDIF.
CONCATENATE 'MSICHTAUSW-DYTXT(' w_data-count ')' INTO w_data-field1.
CONCATENATE 'MSICHTAUSW-KZSEL(' w_data-count ')' INTO w_data-field2.
ENDIF.
READ TABLE t_bildtab_dup WITH KEY dytxt = c_sd_view.
IF t_bildtab_dup-kzanz = 'X'.
WRITE sy-tabix TO w_data-count.
IF w_data-anzd70 > 18.
w_data-count = w_data-count + 2.
w_data-count = w_data-count - 18.
ENDIF.
CONCATENATE 'MSICHTAUSW-DYTXT(' w_data-count ')' INTO w_data-field3.
CONCATENATE 'MSICHTAUSW-KZSEL(' w_data-count ')' INTO w_data-field4.
ENDIF.
ENDFORM. " f612_view_sort
*& Form f_uplaod_data *
Routine to used for Uploading the data from file to Internal table *
FORM f_uplaod_data.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = g_file
filetype = 'DAT'
TABLES
data_tab = t_delim
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
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF t_bpcs IS INITIAL.
LOOP AT t_delim.
SPLIT t_delim-text AT ',' INTO t_bpcs-matnr
t_bpcs-dosage
t_bpcs-appearance
t_bpcs-idcode
t_bpcs-prostformno
t_bpcs-weitab
t_bpcs-uom1
t_bpcs-uom2
t_bpcs-carsize
t_bpcs-cassize
t_bpcs-rupqty
t_bpcs-abvname.
APPEND t_bpcs.
ENDLOOP.
ENDIF.
ENDFORM. " f_uplaod_data
*& Form F_BDC_OPEN
Routine to create BDC Session to be processed
FORM f_bdc_open.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = c_group
keep = c_keep
user = sy-uname
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.
ELSE.
MESSAGE S000 WITH 'Batch input session is created successfully'(T02).
ENDIF.
ENDFORM. " F_BDC_OPEN
*& Form F_PROCESS_BDC
Processing of BDCDATA Structure
FORM f_process_bdc.
LOOP AT t_mdata.
PERFORM f612_view_sort.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=AUSW'.
PERFORM f_bdc_field USING 'RMMG1-MATNR'
t_mdata-matnr.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
IF w_data-anzd70 > 18.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
ENDIF.
reading the t_bildtab internal table
READ TABLE t_bildtab_dup WITH KEY dytxt = c_scm_view.
IF t_bildtab_dup-kzanz = 'X'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
w_data-field1.
PERFORM f_bdc_field USING w_data-field2 'X'.
g_flag = 'X'.
ENDIF.
reading the t_bildtab internal table
READ TABLE t_bildtab_dup WITH KEY dytxt = c_sd_view.
IF sy-subrc EQ 0.
g_flag = 'X'.
ENDIF.
IF t_bildtab_dup-kzanz = 'X'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
w_data-field3.
PERFORM f_bdc_field USING w_data-field4 'X'.
g_flag1 = 'X'.
ENDIF.
IF g_flag = 'X' AND g_flag1 = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-VTWEG'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'RMMG1-VKORG'
c_vkorg.
PERFORM f_bdc_field USING 'RMMG1-VTWEG'
c_vtweg.
CLEAR g_flag.
CLEAR g_flag1.
ELSE.
IF g_flag = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
ELSE.
IF g_flag1 = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-VTWEG'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'RMMG1-VKORG'
c_vkorg.
PERFORM f_bdc_field USING 'RMMG1-VTWEG'
c_vtweg.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDIF.
ENDIF.
*Processing of SCM View
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM f_bdc_field USING 'BDC_CURSOR' 'MARC-ZZJP_DOS_FRM'.
PERFORM f_bdc_field USING 'MARC-ZZJP_DOS_FRM'
t_mdata-zzjp_dos_frm.
PERFORM f_bdc_field USING 'MARC-ZZJP_APRN'
t_mdata-zzjp_aprn.
PERFORM f_bdc_field USING 'MARC-ZZJP_CON_ID'
t_mdata-zzjp_con_id.
PERFORM f_bdc_field USING 'MARC-ZZJP_NYU_SOP'
t_mdata-zzjp_nyu_sop.
PERFORM f_bdc_field USING 'MARC-ZZJP_WEI_TAB'
t_mdata-zzjp_wei_tab.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAR'
t_mdata-zzjp_car.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAS'
t_mdata-zzjp_cas.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAR_SIZE'
t_mdata-ZZJP_CAR_SIZE.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAS_SIZE'
t_mdata-ZZJP_CAS_SIZE.
PERFORM f_bdc_field USING 'MARC-ZZJP_RUPQTY'
t_mdata-ZZJP_RUPQTY.
PERFORM f_bdc_field USING 'MARC-ZZJP_BIO'
t_mdata-zzjp_bio.
PERFORM f_bdc_field USING 'MARC-ZZJP_ITF'
t_mdata-zzjp_itf.
PERFORM f_bdc_field USING 'MARC-ZZJP_INIT_LS'
t_mdata-zzjp_init_ls.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE1'
t_mdata-zzjp_re1.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE2'
t_mdata-zzjp_re2.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE3'
t_mdata-zzjp_re3.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'/00'.
*Processing of SD View
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM f_bdc_field USING 'BDC_CURSOR' 'MVKE-ZZJP_PRO_ID'.
PERFORM f_bdc_field USING 'MVKE-ZZJP_PRO_ID'
t_mdata-zzjp_pro_id.
PERFORM f_bdc_field USING 'MVKE-ZZJP_BU_ID'
t_mdata-zzjp_bu_id.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_NAME'
t_mdata-zzjp_abv_name.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_ID1'
t_mdata-zzjp_abv_id1.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_ID2'
t_mdata-zzjp_abv_id2.
PERFORM f_bdc_field USING 'MVKE-ZZJP_SPL_ID'
t_mdata-zzjp_spl_id.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM f_bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=YES'.
perform f_bdc_insert.
REFRESH T_BDCDATA.
ENDLOOP.
ENDFORM. " F_PROCESS_BDC
*& Form f_bdc_dynpro
p_prog is the program name to which data is passed *
p_dyno is the screen number to which the data is passed
Routine for populating the BDCDATA structure with the
Screen related information
FORM f_bdc_dynpro USING p_prog
p_dyno.
t_bdcdata-program = p_prog.
t_bdcdata-dynpro = p_dyno.
t_bdcdata-dynbegin = 'X'.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " F_bdc_dynpro
*& Form F_BDC_FIELD
p_fnam is the field name to which value is passed
p_fval is the field value which is passed
p_fnam is the field name to which value is passed
p_fval is the field value which is passed
FORM f_bdc_field USING p_fnam
p_fval.
t_bdcdata-fnam = p_fnam.
t_bdcdata-fval = p_fval.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " F_bdc_field
*& Form F_PROCESS_DATA *
Routine to used for moving data from T_bpcs internal table to *
t_mdata Internal Table *
FORM f_process_data.
LOOP AT t_bpcs.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_bpcs-matnr
IMPORTING
output = t_mdata-matnr.
MOVE t_bpcs-dosage TO t_mdata-zzjp_dos_frm.
MOVE t_bpcs-appearance TO t_mdata-zzjp_aprn.
MOVE t_bpcs-idcode TO t_mdata-zzjp_con_id.
MOVE t_bpcs-prostformno TO t_mdata-zzjp_nyu_sop.
MOVE t_bpcs-weitab TO t_mdata-zzjp_wei_tab.
MOVE c_blank TO t_mdata-zzjp_bio.
MOVE c_blank TO t_mdata-zzjp_itf.
MOVE t_bpcs-uom1 TO t_mdata-zzjp_car.
MOVE t_bpcs-uom2 TO t_mdata-zzjp_cas.
MOVE t_bpcs-carsize TO t_mdata-zzjp_car_size.
MOVE t_bpcs-cassize TO t_mdata-zzjp_cas_size.
MOVE t_bpcs-rupqty TO t_mdata-zzjp_rupqty.
MOVE c_intls TO t_mdata-zzjp_init_ls.
MOVE c_blank TO t_mdata-zzjp_re1.
MOVE c_blank TO t_mdata-zzjp_re2.
MOVE c_blank TO t_mdata-zzjp_re3.
MOVE c_blank TO t_mdata-zzjp_pro_id.
MOVE c_blank TO t_mdata-zzjp_bu_id.
MOVE t_bpcs-abvname TO t_mdata-zzjp_abv_name.
MOVE c_blank TO t_mdata-zzjp_abv_id1.
MOVE c_blank TO t_mdata-zzjp_abv_id2.
MOVE c_blank TO t_mdata-zzjp_spl_id.
APPEND t_mdata.
ENDLOOP.
ENDFORM. " F_PROCESS_DATA
*& Form f_bdc_close
Routine to close the BDC Session
FORM f_close_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.
ENDFORM. " f_close_group
*& Form f_bdc_insert
routine to input batch data into the Transaction MM02 from the
session created
FORM f_bdc_insert.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = c_tcode
TABLES
dynprotab = t_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.
ENDFORM. " f_bdc_insert
Reward Points if it is helpful
Thanks
Seshu -
Problem in BDC FOR uploading more than 1 insep. typ in QM view for MM01
Hi,
I had made a BDC in which i am trying to upload the data for the QM view which is being extended in it but the problem is when the program reaches the to QM view it is only able to upload only 1 inspection Type which is working fine but when there is more than 1 it gives error that its QM View has already maintained. Please provide me guiddlines how to solve this problem .
Here's is the link to the code which i am trying to modify:-
http://docs.google.com/Edit?id=dngp529_2fxwgmrgg
Edited by: ricx .s on Apr 16, 2009 2:30 PMhi,
But is it not possible that while creating the insepction type for the first it should simultaneously take the value of 2nd inspection type .
see,ina bdc of qp01 or ca01 we can insert the values at the screen but why can't we do d same in the bdc of mm01,
I had made a bdc for tcode MM02 in which i am able to upload the data but in that there is a problem that some of the materials have the Quality managmnt View at position no. 11 or 13 of the screen.
here's is d link for the code of the program :-
http://docs.google.com/Doc?id=dngp529_3wcgnjdf3
plzz provide me guidelines how to solve it .
Edited by: ricx .s on Apr 17, 2009 9:26 AM
Edited by: ricx .s on Apr 17, 2009 10:56 AM -
Hi,
I am working on a BDC for the tcode MM02 in which i have to insert the Inspection Type in the Quality Managment View of materials. i had executed the code which was working fine,but when i executed it ,it remains on the same screen where the after specifying on the file path. I dont know why it is happening ,plzz provide me guidelines for solving this problem.report ZMM02 no standard page heading line-size 255.
include bdcrecx1.
DATA: BEGIN OF ZVBM OCCURS 0,
MATNR(18) TYPE C,
BRGEW(16) TYPE C,
NTGEW(16) TYPE C,
END OF ZVBM.
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'c:\vijay.txt'
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = ZVBM
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
OTHERS = 10
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_group.
LOOP AT ZVBM.
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'
zvbm-matnr.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'MAKT-MAKTX'
'VIJAY3'.
perform bdc_field using 'MARA-MEINS'
'KG'.
perform bdc_field using 'MARA-MATKL'
'01'.
perform bdc_field using 'MARA-SPART'
'01'.
perform bdc_field using 'BDC_CURSOR'
'MARA-NTGEW'.
perform bdc_field using 'MARA-BRGEW'
zvbm-brgew.
perform bdc_field using 'MARA-GEWEI'
'KG'.
perform bdc_field using 'MARA-NTGEW'
zvbm-ntgew.
perform bdc_transaction using 'MM02'.
ENDLOOP.
perform close_group. -
Problem in BDC: Not Picking the second entry of file
Dear Friends,
I have been working on a BDC and have been facing a problem. This code uploads the first entry of my file properly but repeats the same entry again second time, doesn't refresh or take the second entry of the file.
Please have a look at the code & suggest the necessary corrections.
Regards,
Alok.
report ZFBPS_BDC
no standard page heading line-size 255.
data: bdcdata1 like bdcdata occurs 0 with header line.
data : vf_index type i.
*include bdcrecx1.
DATA: BEGIN OF ENTRIES OCCURS 0,
RECNO(5),
NEWBS(2),
NEWKO(17),
NEWNUM(1),
WRBTR(13),
GSBER(4),
KOSTL(10),
SECCO(4),
ZFBDT(8),
zuonr(18),
SGTXT(50),
FMORE(1),
HKONT(10),
PRCTR(10),
AUFNR(3),
MWSKZ(2),
XBLNR(16),
BKTXT(25),
END OF ENTRIES.
DATA: TEMP(8),
DOCDATE(8),
SPLGL(1),
PKEY(2),
GL(17),
VCHAMT(13),
BUSAREA(4),
SECCODE(4),
FBDT(8),
zzuonr(18),
COSTCEN(10),
AUFNR(3),
SGTXT(50).
data : vf_start_col type i value '1', "start column
vf_start_row type i value '1', "start row
vf_end_col type i value '256', "maximum column
vf_end_row type i value '65536', "maximum row
p_text(20). "stores error messages
Internal Table
data : it_excel type kcde_cells occurs 0 with header line.
*/ Field symbol
field-symbols : <fs>.
parameters: p_file LIKE rlgrap-filename MEMORY ID M01,
NOHEADER AS CHECKBOX.
parameters: COMPANY(4) TYPE C DEFAULT 'SCL',
GROUP(12) TYPE C DEFAULT 'BDCTEST',
USER(12) TYPE C DEFAULT SY-UNAME,
KEEP(1) TYPE C DEFAULT 'X',
POSTDATE LIKE SY-DATUM DEFAULT SY-DATUM,
DOC_TYPE(2) TYPE C DEFAULT 'KR',
HOLDDATE LIKE SY-DATUM.
***********************************************upload data from excel
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = p_file
i_begin_col = VF_START_COL
i_begin_row = VF_START_ROW
i_end_col = VF_END_COL
i_end_row = VF_END_ROW
tables
intern = IT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3 .
IF sy-subrc <> 0.
WRITE: / 'EXCEL UPLOAD FAILED :', p_file, SY-SUBRC.
else.
sort it_excel by row col.
loop at it_excel.
IF NOHEADER = 'X'
AND It_EXCEL-row = 1.
CONTINUE.
ENDIF.
vf_index = it_excel-col.
assign component vf_index of structure ENTRIES to <fs>.
move it_excel-value to <fs>.
at end of row.
append ENTRIES.
clear ENTRIES.
endat.
endloop.
endif.
start-of-selection.
LOOP AT ENTRIES.
WRITE: / ENTRIES-RECNO,
ENTRIES-NEWBS,
ENTRIES-NEWKO,
ENTRIES-NEWNUM,
ENTRIES-WRBTR,
ENTRIES-GSBER,
ENTRIES-SECCO,
ENTRIES-ZFBDT,
ENTRIES-ZUONR,
ENTRIES-SGTXT.
ENDLOOP.
WRITE: / 'THIS IS THE BDC PROGRAM FOR SAMTEL'.
perform bdc_dynpro using 'SAPMF05A' '0100'.
perform bdc_field using 'BDC_OKCODE' '/00'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RF05A-NEWKO'.
TEMP = POSTDATE.
DOCDATE = TEMP+6(2).
DOCDATE2(2) = TEMP4(2).
DOCDATE4(4) = TEMP0(4).
*PERFORM BDC_FIELD USING 'BKPF-BLDAT' DOCDATE.
*PERFORM BDC_FIELD USING 'BKPF-BLART' DOC_TYPE.
*PERFORM BDC_FIELD USING 'BKPF-BUKRS' COMPANY.
*PERFORM BDC_FIELD USING 'BKPF-WAERS' 'INR'.
*PERFORM BDC_FIELD USING 'BKPF-BUDAT' DOCDATE.
*PERFORM BDC_FIELD USING 'BKPF-XBLNR' 'Deepak'.
*PERFORM BDC_FIELD USING 'BKPF-BKTXT' 'Sahib'.
LOOP AT ENTRIES.
REFRESH BDCDATA1.
perform bdc_dynpro using 'SAPMF05A' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'BKPF-BLDAT' DOCDATE.
PERFORM BDC_FIELD USING 'BKPF-BLART' DOC_TYPE.
PERFORM BDC_FIELD USING 'BKPF-BUKRS' COMPANY.
PERFORM BDC_FIELD USING 'BKPF-WAERS' 'INR'.
PERFORM BDC_FIELD USING 'BKPF-BUDAT' DOCDATE.
PERFORM BDC_FIELD USING 'BKPF-XBLNR' 'Deepak'.
PERFORM BDC_FIELD USING 'BKPF-BKTXT' 'Sahib'.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-ZUONR'
ENTRIES-ZUONR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_field using 'DKACB-FMORE'
ENTRIES-FMORE.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-KOSTL'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_field using 'COBL-KOSTL'
ENTRIES-KOSTL.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-ZUONR'
ENTRIES-ZUONR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_field using 'DKACB-FMORE'
ENTRIES-FMORE.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_field using 'COBL-KOSTL'
ENTRIES-KOSTL.
perform bdc_field using 'COBL-PRCTR'
ENTRIES-PRCTR.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_field using 'DKACB-FMORE'
ENTRIES-FMORE.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-WRBTR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'DKACB-FMORE'
ENTRIES-FMORE.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_field using 'DKACB-FMORE'
ENTRIES-FMORE.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_field using 'DKACB-FMORE'
ENTRIES-FMORE.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_dynpro using 'SAPMF05A' '0300'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_field using 'RF05A-NEWBS'
ENTRIES-NEWBS.
perform bdc_field using 'RF05A-NEWKO'
ENTRIES-NEWKO.
perform bdc_field using 'DKACB-FMORE'
ENTRIES-FMORE.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-GSBER'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-GSBER'
ENTRIES-GSBER.
perform bdc_dynpro using 'SAPMF05A' '0302'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT'.
perform bdc_field using 'BDC_OKCODE'
'=AB'.
perform bdc_field using 'BSEG-HKONT'
ENTRIES-HKONT.
perform bdc_field using 'BSEG-WRBTR'
ENTRIES-WRBTR.
perform bdc_field using 'BSEG-MWSKZ'
ENTRIES-MWSKZ.
perform bdc_field using 'BSEG-ZFBDT'
ENTRIES-ZFBDT.
perform bdc_field using 'BSEG-SGTXT'
ENTRIES-SGTXT.
perform bdc_dynpro using 'SAPLFWTD' '0100'.
perform bdc_field using 'BDC_CURSOR'
'WITH_ITEM-WT_WITHCD(01)'.
perform bdc_field using 'BDC_OKCODE'
'=GO'.
perform bdc_dynpro using 'SAPMF05A' '0700'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWBS'.
perform bdc_field using 'BDC_OKCODE'
'=BS'.
perform bdc_field using 'BKPF-XBLNR'
ENTRIES-XBLNR.
perform bdc_field using 'BKPF-BKTXT'
ENTRIES-BKTXT.
perform bdc_dynpro using 'SAPMF05A' '0700'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWBS'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BKPF-XBLNR'
ENTRIES-XBLNR.
perform bdc_field using 'BKPF-BKTXT'
ENTRIES-BKTXT.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
call transaction 'FB01' using bdcdata1 mode 'A'.
ENDLOOP.
Start new screen *
form bdc_dynpro using program dynpro.
clear bdcdata1.
bdcdata1-program = program.
bdcdata1-dynpro = dynpro.
bdcdata1-dynbegin = 'X'.
append bdcdata1.
endform.
Insert field *
form bdc_field using fnam fval.
clear bdcdata1.
bdcdata1-fnam = fnam.
bdcdata1-fval = fval.
append bdcdata1.
endform.Hi
You better use LSMW instaed of using BDC for FB01 Transaction. The Problem is not with REFRESH.
Regards,
Anji -
Problem in bdc for table control for line items
Hi experts,
I am runnig a bdc for ME52.
i am just entering PR number, in the second screen i have got all the line items. I need to select these line item 10 and double click or hit enter, it takes me to screen 3, there im just checking a checkbox and saving.
Again i need to select the line item 20 and double click or hit enter. again the same process.
Again repeat for all the line items.
But my problem is it is updating everytime for only line item 10. for line item 20 and others it say "no chnge in the data".
I am pasting my code here. please check and revert me back .plz.
DATA: w_output LIKE LINE OF i_output.
REFRESH I_ITAB[].
SELECT * FROM EBAN
INTO TABLE i_itab
WHERE banfn in s_banfn AND
bsart in s_bsart AND
bstyp in s_bstyp AND
matnr in s_matnr AND
werks in s_werks AND
lfdat in s_lfdat AND
pstyp in s_pstyp AND
knttp in s_knttp AND
estkz in s_estkz AND
loekz eq ' '.
IF sy-subrc = 0.
CLEAR: w_itab,
i_poitab[].
SORT i_itab by banfn.
LOOP AT i_itab INTO w_itab where menge GT eban-bsmng.
IF p_close = 'X' AND p_rep = 'X'.
IF w_itab-ebakz = 'X'.
w_itab-ebakz = ' '.
APPEND w_itab to i_poitab.
ENDIF.
ELSEIF p_open = 'X' AND p_rep = 'X'.
IF w_itab-ebakz = ' '.
w_itab-ebakz = 'X'.
APPEND w_itab to i_poitab.
ENDIF.
ELSEIF p_close = 'X' AND p_repw = 'X'.
IF w_itab-ebakz = ' '.
APPEND w_itab to i_poitab.
ENDIF.
ELSEIF p_open = 'X' AND p_repw = 'X'.
IF w_itab-ebakz = 'X'.
APPEND w_itab to i_poitab.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
LOOP AT i_poitab into w_output.
APPEND w_output to i_output.
PERFORM CALL_BDC.
endloop.
IF p_rep = 'X'.
PERFORM CALL_BDC.
ENDIF.
ENDFORM. " GET_DATA
*& Form CALL_BDC
text
--> p1 text
<-- p2 text
FORM CALL_BDC.
DATA: seltab(5) TYPE N,
seltab1(2) TYPE N,
tempvar(30) TYPE N,
cnt TYPE N.
LOOP AT i_output.
clear: seltab,
seltab1.
seltab = i_output-bnfpo.
seltab1 = seltab+2(2).
perform bdc_dynpro using 'SAPMM06B' '0105'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-BANFN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-BANFN'
i_output-banfn.
perform bdc_dynpro using 'SAPMM06B' '0106'.
clear tempvar.
*cnt = 1.
concatenate 'EBAN-BNFPO(' seltab1 ')' into tempvar.
perform bdc_field using 'BDC_CURSOR'
'EBAN-BNFPO(seltab1)'.
tempvar.
perform bdc_field using 'BDC_OKCODE'
'=DETA'.
perform bdc_field using 'RM06B-BNFPO'
i_output-bnfpo.
perform bdc_field using 'RM06B-TCSELFLAG(seltab1)'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-EBAKZ'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'EBAN-EBAKZ'
i_output-ebakz.
CALL TRANSACTION 'ME52' USING bdc_data MODE 'A'
MESSAGES INTO i_bdcmsg.
COMMIT WORK AND WAIT.
ENDLOOP.
ENDFORM. " CALL_BDC
*& Form bdc_dynpro
text
-->P_0686 text
-->P_0687 text
FORM bdc_dynpro USING program dynpro.
CLEAR bdc_data.
bdc_data-program = program.
bdc_data-dynpro = dynpro.
bdc_data-dynbegin = 'X'.
APPEND bdc_data.
CLEAR bdc_data.
ENDFORM.
thanks,
NLooks like table control logic is wrong -- do compare with below program...
only table contril area
REPORT ZPadmam
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
DATA : c TYPE i.
INCLUDE bdcrecx1.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
itab-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
itab-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
itab-sortl.
PERFORM bdc_field USING 'LFA1-LAND1'
itab-land1.
PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-FDGRV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFB1-AKONT'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-fdgrv.
PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB1-ZTERM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFB5-MAHNA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFM1-WAERS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFM1-WAERS'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.
Thanks
Seshu -
Dear Experts ,
I am doing a BDC for MB1B...
In my selection screen I am having,
Plant, Vendor No, text and and options to enter 5 different materials and its corresponding qauntity.
When the user enter the above details and execute , these details should trigger in MB1B
( using BDC background ).
My problem is i the final stage where the document needs to get saved, as in my case
its getting saved and also if the user enters only 1 material the loop should happen only once, but here
its getting looped with balnk values.
I have pasted my code below, please have look and advice me.
REFRESH: BDCDATA, MESSTAB.
PERFORM DYNPRO USING:
'X' 'SAPMM07M' '0400',
' ' 'RM07M-BWARTWA' '941',
' ' 'RM07M-WERKS' itab-WERKS,
' ' 'RM07M-LGORT' itab-LGORT,
' ' 'MKPF-BKTXT' itab-BKTXT,
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMM07M' '0421',
' ' 'MSEGK-UMWRK' itab-WERKS,
' ' 'MSEGK-LIFNR' itab-VEND,
' ' 'BDC_OKCODE' 'NLE',
'X' 'SAPLKACB' '0002',
' ' 'BDC_OKCODE' '/00'.
LOOP AT ITAB1.
QAN = ITAB1-ERFMG.
QTY = QAN+6(6).
CNT = CNT + 1.
CN = CNT.
CONCATENATE 'MSEG-MATNR(' CN ')' INTO FN1.
CONCATENATE 'MSEG-ERFMG(' CN ')' INTO FN2.
PERFORM DYNPRO USING:
'X' 'SAPMM07M' '0421',
' ' FN1 ITAB1-MATNR,
' ' FN2 QTY,
' ' 'BDC_OKCODE' '/00',
'X' 'SAPLKACB' '0002',
' ' 'BDC_OKCODE' '=ENTE'.
ENDLOOP.
CALL TRANSACTION 'MB1B' USING BDCDATA MODE 'A'Hi Naga,
Thanks a lot for ur valuable advice !!
Now my document is getting posted , while using:
*CALL TRANSACTION 'MB1B' USING BDCDATA MODE 'A' *
but when I am using
*CALL TRANSACTION 'MB1B' USING BDCDATA MODE 'N' *
I am getting 'S' message No batch input data for screen SAPLKACB 0002.
I am pasting my code please have a look and advice me.
REFRESH: BDCDATA, MESSTAB.
PERFORM DYNPRO USING:
'X' 'SAPMM07M' '0400',
' ' 'RM07M-BWARTWA' '941',
' ' 'RM07M-WERKS' S_WERKS,
' ' 'RM07M-LGORT' S_LGORT,
' ' 'MKPF-BKTXT' S_BKTXT,
' ' 'BDC_OKCODE' '/00',
'X' 'SAPMM07M' '0421',
' ' 'MSEGK-UMWRK' S_WERKS,
' ' 'MSEGK-LIFNR' S_VEND,
' ' 'BDC_OKCODE' 'NLE',
'X' 'SAPLKACB' '0002',
' ' 'BDC_OKCODE' '/00'.
LOOP AT ITAB.
DELETE ITAB WHERE MATNR IS INITIAL.
QAN = ITAB-ERFMG.
QTY = QAN+6(6).
CNT = CNT + 1.
CN = CNT.
CONCATENATE 'MSEG-MATNR(' CN ')' INTO FN1.
CONCATENATE 'MSEG-ERFMG(' CN ')' INTO FN2.
PERFORM DYNPRO USING:
'X' 'SAPMM07M' '0421',
' ' FN1 ITAB-MATNR,
' ' FN2 QTY,
' ' 'BDC_OKCODE' '/00'.
ENDLOOP.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
PERFORM BDC_FIELD USING 'DKACB-FMORE'
'X'.
PERFORM DYNPRO USING 'X' 'SAPLKACB' '0002'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTE'.
CALL TRANSACTION 'MB1B' USING BDCDATA MODE 'N'
MESSAGES INTO MESSTAB.
Rgds
Karthik -
Problem in BDC for Transaction F-02
Hi Friends,
I am struck up in BDC for TransactionF-02.i am unable to load the data of my test data.when i am loading its loading the second record not the first record.
Below is the test data
H,RAWATEB,1
M,11072006,ZE,1000,11072006,20,SAR,,,,,RAWATIB,,SALARIES,1000
D,50,482000,3648.61,Z1,,,1000,1111,,,,,,
D,40,113001,3648.61,Z1,,,1000,,,,,,,
D,17,001011,3000000.00,Z1,,,1000,,,,,,,
D,40,113001,3000000.00,Z1,,,1000,,,,,,,
M,17082004,ZE,1000,11072006,20,SAR,,,,,RAWATIB,,SALARIES,1000
D,50,482000,3202.82,Z1,,,1000,1112,,,,,,
D,40,113001,3202.82,Z1,,,1000,,,,,,,
D,50,482000,2600000.00,Z1,,,1000,1111,,,,,,
D,40,001011,2600000.00,Z1,,,1000,,,,,,,
T,0000000002
<b></b>
the report is below
REPORT ZFGLDR0030 line-count 60
line-size 160
message-id 00.
====================================================================
****************************TABLES**********************************
====================================================================
tables: bkpf.
====================================================================
**************************RECORD LAYOUTS****************************
====================================================================
Data: begin of bdc_tab occurs 200.
include structure bdcdata.
data: end of bdc_tab.
Data: Begin of tmp_tab occurs 200,
fld1(255) type c,
end of tmp_tab.
DATA: BEGIN OF upload_tab OCCURS 200,
fld1(1) type c,
fld2(10) type c,
fld3(10) type c,
fld4(16) type c,
fld5(10) type c,
fld6(2) type c,
fld7(4) type c,
fld8(10) type c,
fld9(10) type c,
fld10(10) type c,
fld11(10) type c,
fld12(12) type c,
fld13(25) type c,
fld14(50) type c,
fld15(4) type c,
fld16(1) type c,
END OF upload_tab.
data : tmp_rec like upload_tab.
DATA: BEGIN OF upload1_tab OCCURS 200,
fld1(1) type c,
fld2(10) type c,
fld3(10) type c,
fld4(16) type c,
fld5(10) type c,
fld6(2) type c,
fld7(4) type c,
fld8(10) type c,
fld9(10) type c,
fld10(10) type c,
fld11(10) type c,
fld12(12) type c,
fld13(25) type c,
fld14(50) type c,
fld15(4) type c,
fld16(1) type c,
END OF upload1_tab.
Data: upload2_tab like tmp_rec occurs 200 with header line.
Data: Del_tab like tmp_rec occurs 200 with header line.
DATA: V_SYTABIX TYPE I,
v_kunnr like knb1-kunnr,
v_brsch like kna1-brsch,
v_datum like sy-datum,
v_tmp(1) type c,
v_flag type i,
v_ccode(10) type c,
v_glcd(10) type c,
v_len type n,
v_rem(50) type c,
v_docno(12) type c,
v_dtype(3) type c,
v_sno(8) type n,
v_upd_flag type i,
v_idx like sy-tabix,
v_budat like bkpf-budat,
v_fld5(10) type c,
v_date(10) type c.
====================================================================
*********************SELECTION-SCREEN******************************
====================================================================
selection-screen: begin of block b1 with frame .
parameters:p_fl_mct like rlgrap-filename
default 'C:\test' obligatory,
p_sesid like apqi-groupid default 'RAWATIB',
p_user like apqi-userid default sy-uname.
selection-screen: end of block b1.
selection-screen: begin of block b2 with frame .
parameters:p_opt1 radiobutton group grp1 default 'X',
p_opt2 radiobutton group grp1,
p_budat like bkpf-budat.
selection-screen: end of block b2.
====================================================================
Validate SELECTION-SCREEN **************************
====================================================================
At Selection-screen.
translate p_fl_mct to upper case.
if p_opt2 = 'X' and p_budat = '00000000'.
message e398(00) with 'Please enter date to use as Posting date'.
endif.
at selection-screen on value-request for p_fl_mct.
data : v_mask(120) type c.
v_mask = ',IT2 files (.),.'.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
MASK = v_mask
TITLE = 'File Selection for Upload'
IMPORTING
FILENAME = p_fl_mct
RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
end-of-selection.
====================================================================
*****************************CONSTANTS******************************
====================================================================
====================================================================
*****************************VARIABLES******************************
====================================================================
====================================================================
TOP OF PAGE*******************************
====================================================================
top-of-page.
start-of-selection.
v_upd_flag = 0.
perform initialise_process.
perform bdc_open.
perform process_upload_tab.
perform terminate_process.
end-of-selection.
====================================================================
Form : Initialise_Process *
====================================================================
FORM initialise_process.
Initialises variables *
move : sy-repid to sy-tvar0,
sy-uname to sy-tvar1,
p_sesid to sy-tvar2,
sy-pagno to sy-tvar3.
write: sy-datum to sy-tvar4,
sy-uzeit to sy-tvar5.
Selecting the GL codes to be updated**********************
call function 'WS_UPLOAD'
EXPORTING
FILENAME = p_fl_mct
FILETYPE = 'ASC'
TABLES
data_tab = Tmp_tab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
OTHERS = 10.
if sy-subrc <> 0.
message e398(00) with 'Unable to upload data'.
endif.
Validation for Upload file **********************
read table tmp_tab index 1.
split tmp_tab-fld1 at ',' into tmp_rec-fld1
tmp_rec-fld2
tmp_rec-fld3
tmp_rec-fld4
tmp_rec-fld5
tmp_rec-fld6
tmp_rec-fld7
tmp_rec-fld8
tmp_rec-fld9
tmp_rec-fld10
tmp_rec-fld11
tmp_rec-fld12
tmp_rec-fld13
tmp_rec-fld14
tmp_rec-fld15
v_tmp.
if tmp_rec-fld2 <> 'RAWATEB'.
message e398(00) with 'Invliad file format, cannot upload'.
endif.
loop at tmp_tab.
clear upload_tab.
v_tmp = tmp_tab-fld1+0(1).
if v_tmp = 'M' or v_tmp = 'D'.
split tmp_tab-fld1 at ',' into upload_tab-fld1
upload_tab-fld2
upload_tab-fld3
upload_tab-fld4
upload_tab-fld5
upload_tab-fld6
upload_tab-fld7
upload_tab-fld8
upload_tab-fld9
upload_tab-fld10
upload_tab-fld11
upload_tab-fld12
upload_tab-fld13
upload_tab-fld14
upload_tab-fld15
v_tmp.
if upload_tab-fld1 = 'M'.
clear tmp_rec.
move upload_tab to tmp_rec.
else.
clear upload1_tab.
move upload_tab to upload1_tab.
upload1_tab-fld10 = tmp_rec-fld2.
upload1_tab-fld12 = tmp_rec-fld12.
upload1_tab-fld15 = tmp_rec-fld15.
append upload1_tab.
endif.
append upload_tab.
endif.
endloop.
Mark the already uploaded Transaction to skip ***********
Loop at upload_tab.
if upload_tab-fld1 = 'M'.
v_idx = sy-tabix.
move upload_tab-fld24(4) to v_budat0(4).
move upload_tab-fld22(2) to v_budat4(2).
move upload_tab-fld20(2) to v_budat6(2).
Select single * from bkpf where BLART = upload_tab-fld3 and
BUKRS = upload_tab-fld4 and
XBLNR = upload_tab-fld12 and
budat = v_budat.
if sy-subrc = 0.
do 1000 times.
clear del_tab.
move upload_tab to del_tab.
append del_tab.
upload_tab-fld16 = '*'.
modify upload_tab index v_idx.
v_idx = v_idx + 1.
Read table upload_tab index v_idx.
if upload_tab-fld1 = 'M' or sy-subrc <> 0.
exit.
endif.
enddo.
endif.
endif.
endloop.
ENDFORM. "initialise_process
====================================================================
Form : Process_Ord_itab *
====================================================================
FORM process_upload_tab .
v_flag = 0.
loop at upload_tab where fld16 <> '*' .
Performing the Save at the end of Transaction *************
if upload_tab-fld1 = 'M' and v_flag = 1.
perform load_save.
perform bdc_insert.
endif.
Putting the Header information of the document ************
if upload_tab-fld1 = 'M'.
perform load_header.
v_date = v_fld5.
v_rem = upload_tab-fld14.
v_flag = 0.
endif.
Putting the Detail information of the document ************
if upload_tab-fld1 = 'D'.
if upload_tab-fld2 = '40' or upload_tab-fld2 = '50' .
perform Load_next.
v_tmp = v_glcd.
v_len = strlen( upload_tab-fld3 ).
If ( v_tmp = '2' or v_tmp = '4' or v_tmp = '0' ) .
Perform load_ccenter.
elseif v_flag = 1.
perform upload_blank.
endif.
perform load_Detail.
v_flag = 1.
v_glcd = upload_tab-fld3.
v_ccode = upload_tab-fld9.
else.
perform Load_next.
v_tmp = v_glcd.
v_len = strlen( upload_tab-fld3 ).
perform upload_blank.
perform load_Detail_301.
v_flag = 0.
v_glcd = '1'.
endif.
endif.
endloop.
if v_flag = 1.
perform load_save.
endif.
perform bdc_insert.
v_upd_flag = 1.
ENDFORM. "process_upload_tab
====================================================================
Form : BDC_OPEN *
====================================================================
FORM bdc_open.
call function 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = p_sesid
user = p_user
keep = 'X'.
ENDFORM. "bdc_open
====================================================================
Form : Fill_BDC_Tab *
====================================================================
FORM fill_bdc_tab using dynbegin
name
value.
if dynbegin = 'X'.
clear bdc_tab.
move: name to bdc_tab-program,
value to bdc_tab-dynpro,
'X' to bdc_tab-dynbegin.
append bdc_tab.
else.
clear bdc_tab.
move: name to bdc_tab-fnam,
value to bdc_tab-fval.
append bdc_tab.
endif.
ENDFORM. "fill_bdc_tab
====================================================================
Form : BDC_INSERT *
====================================================================
FORM bdc_insert .
call function 'BDC_INSERT'
EXPORTING
tcode = 'F-02'
TABLES
dynprotab = bdc_tab.
refresh bdc_tab.
clear bdc_tab.
ENDFORM. "bdc_insert
====================================================================
Form : BDC_CLOSE *
====================================================================
FORM bdc_close.
call function 'BDC_CLOSE_GROUP'.
ENDFORM. "bdc_close
====================================================================
Form : Terminate_Process *
====================================================================
FORM terminate_process.
perform bdc_close.
ENDFORM. "terminate_process
*& Form load_Header
FORM load_Header.
If upload_tab-fld1 = 'M'.
v_fld5 = upload_tab-fld5.
if p_opt2 = 'X'.
move p_budat6(2) to v_fld50(2).
move p_budat4(2) to v_fld52(2).
move p_budat0(4) to v_fld54(4).
endif.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0100',
' ' 'BDC_CURSOR' 'RF05A-NEWKO',
' ' 'BKPF-BLDAT' upload_tab-fld2,
' ' 'BKPF-BLART' upload_tab-fld3,
' ' 'BKPF-BUKRS' upload_tab-fld4,
' ' 'BKPF-BUDAT' v_fld5,
' ' 'BKPF-WAERS' upload_tab-fld7,
' ' 'BKPF-XBLNR' upload_tab-fld12,
' ' 'BKPF-BKTXT' upload_tab-fld13.
Endif.
ENDFORM. "load_Header
*& Form load_Detail
FORM load_Detail.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0300',
' ' 'BDC_CURSOR' 'BSEG-WRBTR',
' ' 'BSEG-WRBTR' upload_tab-fld4,
' ' 'BSEG-VALUT' v_date,
' ' 'BSEG-SGTXT' v_rem.
ENDFORM. " LOAD_DATA
*& Form load_Detail
FORM load_Detail_301.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0301',
' ' 'BDC_CURSOR' 'RF05A-NEWUM',
' ' 'BSEG-WRBTR' upload_tab-fld4,
' ' 'BSEG-VALUT' v_date,
' ' 'BSEG-SGTXT' v_rem.
ENDFORM. " LOAD_DATA
*& Form load_Next
FORM Load_next.
perform fill_bdc_tab using:
' ' 'RF05A-NEWBS' upload_tab-fld2,
' ' 'RF05A-NEWKO' upload_tab-fld3,
' ' 'BDC_OKCODE' '/00'.
ENDFORM. "Load_next
*& Form load_Save
FORM Load_save.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0300',
' ' 'BDC_OKCODE' '=BU'.
v_tmp = v_glcd.
v_len = strlen( upload_tab-fld3 ).
If ( v_tmp = '2' or v_tmp = '4' or v_tmp = '0' ) .
Perform load_ccenter.
elseif v_flag = 1.
perform upload_blank.
endif.
perform fill_bdc_tab using:
'X' 'SAPMF05A' '0700',
' ' 'BDC_OKCODE' '=BU'.
ENDFORM. "Load_save
*& Form load_CCenter
FORM Load_Ccenter.
perform fill_bdc_tab using:
'X' 'SAPLKACB' '0002',
' ' 'BDC_CURSOR' 'COBL-KOSTL',
' ' 'COBL-KOSTL' '4200-0451',
' ' 'COBL-KOSTL' v_ccode,
' ' 'COBL-KOSTL' '4200-0295',
' ' 'BDC_OKCODE' '/EENTE'.
ENDFORM. "Load_Ccenter
*& Form load_blank
FORM UpLoad_blank.
perform fill_bdc_tab using:
'X' 'SAPLKACB' '0002',
' ' 'BDC_OKCODE' '/EENTE'.
ENDFORM. "UpLoad_blankur code looking ok..
just change it..
call function <b>'WS_UPLOAD'</b>--->to <b>gui_upload</b>
EXPORTING
FILENAME = p_fl_mct
FILETYPE = 'ASC'
TABLES
data_tab = Tmp_tab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
OTHERS = 10.
if sy-subrc <> 0.
message e398(00) with 'Unable to upload data'.
endif. -
Drop Down for Selecting the doc type while uploading?
Hi all,
Is it possible to create some document type in KM so that we can select the doc type and upload the file to specific folder.
What I mean from Doc type is like Doc for Meetings, Doc for activity report.
Is it possible using standard KM features? Urgent help needed pls reply.
Pls send the document regarding this to [email protected]Hi Karan,
I'm not sure if I have understood your issue correctly, but let me try:
1. You want to upload documents to KM
2. Uploading them, you want to categorize them in some way, so that they can be identified as docs for meetings, docs for unit XYZ, etc..
3. After upload, you want each doc to end up in a folder according to its category
If this is what you want, try the following:
1. Create a custom resource property called "category" or something similiar.
2. You may define your possible values for that property. This makes it a drop down box containing the possible values in property view. (You can see property view when uploadinga document)
3. Mark the property as searchable
4. Create a taxonomy using TREX searching your repository for the given values of your custom property
Now you can upload documents, fill the custom property, and some minutes later TREX will create a link to the document in the specified 'category folder'.
If you need some more detailed assistance, please come back.
HTH,
Carsten -
Todo tab: Routes displayed when selecting the List View
Hi,
I have a question about the routes that appear on the workspace's "To do" list view, and how to perform validations when they are clicked.
I've created a process that starts with a form being created by a user. Then, it's validated by a sequence of other users. Each one sees a different set of routes. On one of the steps of the process, one of the routes requires the user to input a text.
The condition is checked on the click event of the AWS_SUBMIT button, where I've also put the text request. If the user is using the card view on the "To do" tab and clicks on the item, the form opens and, when the user submits it, all works as expected. However, if he has the list view and clicks once on the item, the route names appear on the bottom right of the workspace, and he's able to select them. As the form hasn't been opened, there's no control on the selected route, and the user is never asked to input the text. On the next step of the process, which depends on this text, the process gets stalled.
Is it possible to hide these routes on the workspace, disable the list view, or stop the submit if it hasn't been started without opening the form? I know you can customize the workspace, would this allow me to remove the route buttons?
The version we are using is LiveCycle ES 8.2.1.3.
Thank youIs there any way to hide the submit button(green check mark) that appears on the task card when a user saves a form in their draft folder.
Users are bypassing the form validation by submitting a form this way. For instance, a user will fill out the form with values that do not pass validation. They will save the form in their drafts folder. The user will then close the form and navigate to their draft folder. Without opening the form again, they will click the green check box submit button and a form with invalid data will be submitted to the process.
This is LC 8.2.1.3. -
Excel 2013 registry entry for removing the protected view in excel.
Hi All
I am having Office 2013 on my machine. I wanted to remove protected view from my excell which is showing up when I convert pdf to excell using total pdf converter. The protected view is in red color mode. When I tried searching for the same on the net I
found a registry customization for the excel to overcome the issue.
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Security\FileValidation with “EnableOnLoad”=dword:00000000
I tried this out on a machine having 2010 office and it worked but when I tried the same on my machine I could not find FileValidation key but found couple of other keys like Trusted Documents and Trusted Locations. So I tried adding the dword in both the
key locations but could not address the issue. Is there any solution for addressing the issue on 2013 office. My system is a 64 bit one. I tried adding the above key in 64 bit version of excel. I am using windows 8.1 for your information.
Please suggest a solution at the earliest possible time.Hi,
Looks like you want to turn off Office File Validation.
Maybe you should try to create FileValidation Key under the Security.
Remember to Backup you register before you change it.
1.Locate and then select the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Excel\Security
2.Select Security, point to New on the
Edit menu, and then click Key.
Type FileValidation, and then press Enter.
3.Select FileValidation, point to New on the
Edit menu, and then click QWORD Value.
Type EnableOnLoad, and then press ENTER.
Wind Zhang
TechNet Community Support
Maybe you are looking for
-
How can I get rid of Skype ads on a Mac?
I'm running OSX 10.6.8 and have Skype version 6.15. When I open Skype Home a very large square ad pops up with annoying "meet singles in your area" and so on. I've searched for tips and tricks on google to get rid of this advertising but it seems eve
-
CAn't connect to Internet Through Time Capsule-Self Assigned IP Adress
My iBook battery died. After connecting to power source, I can't connect to the internet. I get a message that the iBook is self assigning the IP address. How do I correct this? I've removed the battery & done several restarts with no success.
-
WLC Primary, secondary - when do the AP change WLC?
Hi Guys A Simple question :) When a AP is associated to a WLC, lets call it "WL0C1" and i want to move it to another primary WLC "WLC2". on the [High Availability] phane: Before: Primary Controller: WLC1 - 10.10.10.11 No Secondary WLC after: Primary
-
ステレオ 3Dリグ作成(AfterEffects CC 2014)
AfterEffects CC 2014 で レイヤー→カメラ→ステレオ 3Dリグ作成を選ぶと ↓のメッセージが出てフリーズしますので.解決法をお願いいたします. AfterEffectsエラー:内部確認に失敗しました.(unexpected match name searched for in group) PC環境 OS:windows7 professional ServicePack1 CPU:Intel(R)Xeon(R) CPU E5-1620 v2 @ 3.70GHz 実装メモリ:
-
Can't find my imported music on my laptop
I was unable to log in to my laptop - "user profile could not load........." Anyway, once I'd fixed this issue, I opened iTunes to find I only had the option to download music from the cloud. Anything I did have in my library, is not there. It does