2012 Feb 10 10:22 AM
Hi Guru,
I am creating a module pool program,in module pool program we have 30 input fields through this input field we store the data in z table and pass quantity,serial number and lenght in vl01n. but in forground ground working fine but background showing error.
Please help me. i am sending some code.
PERFORM BDC_NODATA USING NODATA.
PERFORM OPEN_GROUP USING GROUP USER KEEP HOLDDATE CTU.
PERFORM BDC_DYNPRO USING 'SAPMV50A' '4001'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LV50C-BIPOS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'LIKP-VSTEL'
VSTEL_001.
PERFORM BDC_FIELD USING 'LV50C-DATBI'
DATBI_002.
PERFORM BDC_FIELD USING 'LV50C-VBELN'
VBELN_003.
PERFORM BDC_FIELD USING 'LV50C-ABPOS'
ABPOS_004.
PERFORM BDC_FIELD USING 'LV50C-BIPOS'
BIPOS_005.
PERFORM BDC_DYNPRO USING 'SAPMV50A' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=T\02'.
PERFORM BDC_FIELD USING 'LIKP-BLDAT'
BLDAT_006.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LIPS-MATNR(04)'.
PERFORM BDC_FIELD USING 'LIKP-WADAT'
WADAT_007.
PERFORM BDC_FIELD USING 'LIKP-WAUHR'
WAUHR_008.
PERFORM BDC_DYNPRO USING 'SAPMV50A' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'LIKP-BLDAT'
BLDAT_009.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LIPS-LGORT(03)'.
PERFORM BDC_FIELD USING 'LIKP-KODAT'
KODAT_010.
PERFORM BDC_FIELD USING 'LIKP-KOUHR'
KOUHR_011.
PERFORM BDC_FIELD USING 'LIPS-LGORT(01)'
LGORT_01_012.
PERFORM BDC_FIELD USING 'LIPSD-G_LFIMG(01)'
G_LFIMG_01_013.
MOVE 2 TO IDX1.
LOOP AT IT_SEQ INTO WA_SEQ.
QTY1 = WA_SEQ-QTY.
QTY = QTY1.
CONCATENATE 'LIPSD-G_LFIMG(' IDX1 ')' INTO FNAME.
PERFORM BDC_FIELD USING FNAME"'RIPW0-SERNR(01)'
QTY. "'bgl17'.
IDX1 = IDX1 + 1.
ENDLOOP.
*move 2 to idx1.
loop at it_seq into wa_seq.
*
concatenate 'LIPSD-G_LFIMG(' idx1 ')' into fname.
perform bdc_field using fname"'RIPW0-SERNR(01)'
wa_seq-qty. "'bgl17'.
*
idx1 = idx1 + 1.
endloop.
*perform bdc_field using 'LIPSD-G_LFIMG(02)'
G_LFIMG_02_014.
*perform bdc_field using 'LIPSD-G_LFIMG(03)'
G_LFIMG_03_015.
PERFORM BDC_DYNPRO USING 'SAPMV50A' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=PSER_T'.
PERFORM BDC_FIELD USING 'LIKP-BLDAT'
BLDAT_016.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LIPS-POSNR(01)'.
PERFORM BDC_FIELD USING 'LIKP-KODAT'
KODAT_017.
PERFORM BDC_FIELD USING 'LIKP-KOUHR'
KOUHR_018.
PERFORM BDC_FIELD USING 'RV50A-LIPS_SELKZ(01)'
LIPS_SELKZ_01_019.
PERFORM BDC_DYNPRO USING 'SAPLIPW1' '0200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RIPW0-SERNR(02)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=RWS'.
MOVE 1 TO IDX.
LOOP AT ITAB INTO WA.
CONCATENATE 'RIPW0-SERNR(' IDX ')' INTO FNAM.
PERFORM BDC_FIELD USING FNAM"'RIPW0-SERNR(01)'
WA-PSLNO. "'bgl17
IDX = IDX + 1.
ENDLOOP.
*perform bdc_field using 'RIPW0-SERNR(01)'
SERNR_01_020.
*perform bdc_field using 'RIPW0-SERNR(02)'
SERNR_02_021.
PERFORM BDC_DYNPRO USING 'SAPMV50A' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=WABU_T'.
PERFORM BDC_FIELD USING 'LIKP-BLDAT'
BLDAT_022.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LIPS-MATNR(04)'.
PERFORM BDC_FIELD USING 'LIKP-KODAT'
KODAT_023.
PERFORM BDC_FIELD USING 'LIKP-KOUHR'
KOUHR_024.
PERFORM BDC_TRANSACTION TABLES MESSTAB
USING 'VL01N'
CTU
MODE
UPDATE.
2012 Feb 10 10:27 AM
Hi,
Try using "Simulate Background Mode" while recording using SHDB transaction and build program with this recording for background processing and check.
2012 Feb 10 11:36 AM
Can you share what type of errors you are getting in background?
2012 Feb 10 12:32 PM
i am calling bdc code through function module.in message itab i getting
message type 'E' message id 'VL'
msgnr '461' fldname'LV50C-BIPOS' msgv1 ' '
CALL FUNCTION 'ZFM_VL01N_01'
EXPORTING
CTU = 'X'
MODE = 'A'
UPDATE = 'N'
NODATA = '/'
VSTEL_001 = '1010'
DATBI_002 = DATBI_002"'17.03.2011'
VBELN_003 = VBELN"'256'
ABPOS_004 = ABPOS_004 "'10'
BIPOS_005 = BIPOS_005"'30'
BLDAT_006 = BLDAT_009"'16.03.2011'
WADAT_007 = BLDAT_009"'16.03.2011'
WAUHR_008 = TIME "'00:00:00'
BLDAT_009 = BLDAT_009"'16.03.2011'
KODAT_010 = BLDAT_009"'16.03.2011'
KOUHR_011 = TIME "'00:00:00'
LGORT_01_012 = '1105'
G_LFIMG_01_013 = ICOUNT"G_LFIMG_01_013"'2'
G_LFIMG_02_014 = '2'
G_LFIMG_03_015 = '2'
BLDAT_016 = BLDAT_009"'16.03.2011'
KODAT_017 = BLDAT_009"'16.03.2011'
KOUHR_018 = TIME "'00:00:00'
LIPS_SELKZ_01_019 = 'X'
SERNR_01_020 = '3852'
SERNR_02_021 = '3853'
BLDAT_022 = BLDAT_009"'16.03.2011'
KODAT_023 = BLDAT_009"'16.03.2011'
KOUHR_024 = TIME "'00:00:00'
IMPORTING
SUBRC =
TABLES
MESSTAB = MESSTAB[]
ITAB =
IT_SEQ =
2012 Feb 10 3:07 PM
vl01n is an EnjoySAP transaction and not suitable for batch input, particularly in the background. You should search for notes on this. They will probably tell you to use a BAPI instead or use BDC with vl01 instead.
Rob
2012 Feb 19 6:39 AM
hi guru,
any other solution or send me some bapi list.
regards
kk
2012 Feb 20 2:26 PM
Rob gave you the best answer...however, you haven't yet told us what the error is, have you? If you look at that, you will probably see what is going wrong.