Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

vl10b

Former Member
0 Likes
1,232

hi geeks,

i created a BDC in call transaction method for transaction <i>VL10B</i><b></b>. it is for creating deliveries.

in flatfile, i am uploading five fields - Shipping point, Delivery date, Ship-to-party, Purchase order n Material.

it is working well if i am uploading only one PO, but going to function code error/runtime error if i upload more than one PO.

so, is it not possible to upload more than one PO ?

kallu.

hi geeks,

i created a BDC in call transaction method for transaction <i>VL10B</i><b></b>. it is for creating deliveries.

in flatfile, i am uploading five fields - Shipping point, Delivery date, Ship-to-party, Purchase order n Material.

it is working well if i am uploading only one PO, but going to function code error/runtime error if i upload more than one PO.

so, is it not possible to upload more than one PO ?

kallu.

7 REPLIES 7
Read only

Former Member
0 Likes
1,059

Hi Kalyan,

Have you cleared and refreshed your BDCDATA internal table after the call transaction?

Regards,

ravi

Read only

0 Likes
1,059

hi ravi,

ya i allready coded clear n refresh !

tanx

kallu

Read only

0 Likes
1,059

Hi Kalyan,

This is a report type program. I doubt if you can do a BDC for such programs.

Try t o a bdc for vl01 instead.

Regards,

RaVI

Read only

0 Likes
1,059

Hi Kalyan,

ru doing this in loop... endloop?

Thanks,

Vishnu

Read only

0 Likes
1,059

hi vishnu !

yes i am doing it in loop.

thanks,

kallu

Read only

0 Likes
1,059

if you will see the short dump(st22 your respective days dump), then it will show you up where the termination occured. can you give that piece of code.

shane

Read only

0 Likes
1,059

HI SHANE,

pls go thru it.

report ZVL10BSTN no standard page heading line-size 255.

  • Tables

************************************************************************

TABLES : VEPVG, "Delivery Due Index

T100, "Messages

RSCSEL, "Structure for complex selections

VBAP. "Sales Document: Item Data

************************************************************************

  • Internal Tables

************************************************************************

DATA : BEGIN OF ITAB OCCURS 0,

VSTEL(4), "Shipping Point/Receiving Point

LEDAT(8), "Delivery creation date

  • LERUL(),

KUNWE(10), "Ship-To Party

EBELN(10), "Sales and Distribution Document Number

MATNR(18), "Material Number

END OF ITAB.

  • Internal table to get the error data

DATA : IT_ERROR LIKE ITAB OCCURS 0 WITH HEADER LINE.

*Internal table for Batch input: New table field structure

DATA : BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

*Internal table for message

DATA : I_MSGTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

************************************************************************

  • Variables

DATA : G_MESSAGE(200),

g_ftext like tline-tdline,

g_text like tline-tdline.

************************************************************************

  • Selection Screen

************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETER: P_FILE LIKE IBIPPARMS-PATH OBLIGATORY.

SELECTION-SCREEN:END OF BLOCK B1.

************************************************************************

*Initialization

************************************************************************

INITIALIZATION.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE .

PERFORM GET_FILENAME.

**********************************************************************

START-OF-SELECTION.

PERFORM UPLOAD_DATA.

PERFORM FILL_DATA.

END-OF-SELECTION.

**********************************************************************

  • Uploading data file to internal table.

********************************************************************

FORM UPLOAD_DATA.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = P_FILE

FILETYPE = 'DAT'

  • HEADLEN = ' '

  • LINE_EXIT = ' '

  • TRUNCLEN = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • DAT_D_FORMAT = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = ITAB

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.

ENDFORM.

----


  • FORM FILL_DATA *

FORM FILL_DATA.

LOOP AT itab.

at new ebeln.

perform bdc_dynpro using 'RVV50R10C' '1000'.

perform bdc_field using 'BDC_OKCODE'

'=S0S_TAB5'.

perform bdc_field using 'ST_VSTEL-LOW'

itab-vstel.

perform bdc_field using 'ST_LEDAT-LOW'

itab-ledat.

perform bdc_field using 'ST_LEDAT-HIGH'

itab-ledat.

perform bdc_field using 'P_LERUL'

'2'.

perform bdc_field using 'BDC_CURSOR'

'ST_KUNWE-LOW'.

perform bdc_field using 'ST_KUNWE-LOW'

itab-kunwe.

perform bdc_dynpro using 'RVV50R10C' '1000'.

perform bdc_field using 'BDC_OKCODE'

'=%00210300000713501'.

perform bdc_field using 'ST_VSTEL-LOW'

ITAB-VSTEL.

perform bdc_field using 'ST_LEDAT-LOW'

ITAB-LEDAT.

perform bdc_field using 'ST_LEDAT-HIGH'

ITAB-LEDAT.

perform bdc_field using 'P_LERUL'

'2'.

perform bdc_field using 'BDC_CURSOR'

'ST_EBELN-LOW'.

perform bdc_field using 'ST_EBELN-LOW'

ITAB-EBELN.

perform bdc_dynpro using 'SAPLALDB' '3000'.

perform bdc_field using 'BDC_OKCODE'

'=ACPT'.

perform bdc_field using 'BDC_CURSOR'

'RSCSEL-SLOW_I(04)'.

perform bdc_field using 'RSCSEL-SLOW_I(01)'

itab-ebeln.

perform bdc_field using 'RSCSEL-SLOW_I(02)'

itab-ebeln.

*perform bdc_field using 'RSCSEL-SLOW_I(03)'

  • ''.

*perform bdc_field using 'RSCSEL-SLOW_I(04)'

  • ''.

*perform bdc_field using 'RSCSEL-SLOW_I(05)'

  • ''.

*perform bdc_field using 'RSCSEL-SLOW_I(06)'

  • ''.

*perform bdc_field using 'RSCSEL-SLOW_I(07)'

  • ''.

*perform bdc_field using 'RSCSEL-SLOW_I(08)'

  • ''.

*perform bdc_field using 'RSCSEL-SLOW_I(09)'

  • ''.

perform bdc_dynpro using 'RVV50R10C' '1000'.

perform bdc_field using 'BDC_OKCODE'

'=S0S_TAB3'.

perform bdc_field using 'ST_VSTEL-LOW'

ITAB-VSTEL.

perform bdc_field using 'ST_LEDAT-LOW'

ITAB-LEDAT.

perform bdc_field using 'ST_LEDAT-HIGH'

ITAB-LEDAT.

perform bdc_field using 'P_LERUL'

'2'.

perform bdc_field using 'BDC_CURSOR'

'ST_EBELN-LOW'.

perform bdc_field using 'ST_EBELN-LOW'

ITAB-EBELN.

perform bdc_dynpro using 'RVV50R10C' '1000'.

perform bdc_field using 'BDC_OKCODE'

'=%00210400000713501'.

perform bdc_field using 'ST_VSTEL-LOW'

ITAB-VSTEL.

perform bdc_field using 'ST_LEDAT-LOW'

ITAB-LEDAT.

perform bdc_field using 'ST_LEDAT-HIGH'

ITAB-LEDAT.

perform bdc_field using 'P_LERUL'

'2'.

perform bdc_field using 'BDC_CURSOR'

'ST_MATNR-LOW'.

perform bdc_field using 'ST_MATNR-LOW'

ITAB-MATNR.

perform bdc_dynpro using 'SAPLALDB' '3000'.

perform bdc_field using 'BDC_OKCODE'

'=ACPT'.

perform bdc_field using 'BDC_CURSOR'

'RSCSEL-SLOW_I(04)'.

perform bdc_field using 'RSCSEL-SLOW_I(01)'

''.

perform bdc_field using 'RSCSEL-SLOW_I(02)'

''.

perform bdc_field using 'RSCSEL-SLOW_I(03)'

''.

perform bdc_field using 'RSCSEL-SLOW_I(04)'

''.

perform bdc_field using 'RSCSEL-SLOW_I(05)'

''.

perform bdc_field using 'RSCSEL-SLOW_I(06)'

''.

perform bdc_field using 'RSCSEL-SLOW_I(07)'

''.

perform bdc_field using 'RSCSEL-SLOW_I(08)'

''.

perform bdc_field using 'RSCSEL-SLOW_I(09)'

''.

perform bdc_dynpro using 'RVV50R10C' '1000'.

perform bdc_field using 'BDC_OKCODE'

'=ONLI'.

perform bdc_field using 'ST_VSTEL-LOW'

ITAB-VSTEL.

perform bdc_field using 'ST_LEDAT-LOW'

ITAB-LEDAT.

perform bdc_field using 'ST_LEDAT-HIGH'

ITAB-LEDAT.

perform bdc_field using 'P_LERUL'

'2'.

perform bdc_field using 'BDC_CURSOR'

'ST_MATNR-LOW'.

perform bdc_field using 'ST_MATNR-LOW'

ITAB-MATNR.

perform bdc_dynpro using 'SAPLSLVC_FULLSCREEN' '0500'.

perform bdc_field using 'BDC_OKCODE'

'=ANZ1'.

perform bdc_dynpro using 'SAPLSLVC_FULLSCREEN' '0500'.

perform bdc_field using 'BDC_OKCODE'

'=%_GC 349 2'.

perform bdc_dynpro using 'SAPMV50A' '1000'.

perform bdc_field using 'BDC_OKCODE'

'=ANZA_T'.

*perform bdc_field using 'BDC_CURSOR'

  • 'LIKP-VBELN'.

*perform bdc_dynpro using 'SAPMV50A' '1000'.

*perform bdc_field using 'BDC_OKCODE'

  • '=SICH_T'.

*perform bdc_field using 'LIKP-BLDAT'

  • '28.10.2006'.

*perform bdc_field using 'BDC_CURSOR'

  • 'LIPS-MATNR(02)'.

*perform bdc_field using 'LIKP-WADAT'

  • '06.09.2006'.

*perform bdc_field using 'LIKP-WAUHR'

  • '00:00:00'.

*perform bdc_dynpro using 'SAPLSLVC_FULLSCREEN' '0500'.

*perform bdc_field using 'BDC_OKCODE'

  • '=&F03'.

*perform bdc_dynpro using 'RVV50R10C' '1000'.

*perform bdc_field using 'BDC_OKCODE'

  • '/EE'.

*perform bdc_field using 'BDC_CURSOR'

  • 'ST_VSTEL-LOW'.

perform bdc_transaction TABLES I_MSGTAB using 'VL10B' 'E' 'L'.

endat.

************************************************************************

*To fetch the error message from the standard error table

************************************************************************

SELECT SINGLE * FROM T100 WHERE SPRSL = 'E'

AND ARBGB = SY-MSGID

AND MSGNR = SY-MSGNO.

G_MESSAGE = T100-TEXT.

ENDLOOP.

ENDFORM.

----


  • Start new screen *

----


FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM.

----


  • Insert field *

----


FORM BDC_FIELD USING FNAM FVAL.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

ENDFORM.

----


  • FORM BDC_TRANSACTION *

FORM BDC_TRANSACTION TABLES MESSTAB USING TCODE CTUMODE CUPDATE .

CALL TRANSACTION TCODE USING BDCDATA

MODE CTUMODE

UPDATE CUPDATE

MESSAGES INTO MESSTAB.

REFRESH BDCDATA.

CLEAR BDCDATA.

ENDFORM. " bdc_transaction

&----


*& Form get_filename

FORM GET_FILENAME.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

IMPORTING

FILE_NAME = P_FILE .

IF SY-SUBRC NE 0 .

WRITE : / 'Enter File Name'.

ENDIF.

ENDFORM. " get_filename

&----


*& Form check_msg

&----


form check_msg changing pp_delv_note.

perform get_error_message.

  • Error messages

if I_MSGTAB-msgtyp = 'E' or I_MSGTAB-msgtyp = 'A'.

concatenate g_text g_ftext into

g_text separated by '$'.

  • w_return = 'F'.

  • Success messages

elseif I_MSGTAB-msgtyp = 'S'

and ( I_MSGTAB-msgnr = '311' ).

concatenate g_text g_ftext into

g_text separated by '$'.

  • w_return = 'S'.

pp_delv_note = I_MSGTAB-msgv2.

endif.

endform. " check_msg

&----


*& Form get_error_message

&----


form get_error_message.

call function 'MESSAGE_TEXT_BUILD'

exporting

msgid = I_MSGTAB-msgid

msgnr = I_MSGTAB-msgnr

msgv1 = I_MSGTAB-msgv1

msgv2 = I_MSGTAB-msgv2

msgv3 = I_MSGTAB-msgv3

msgv4 = I_MSGTAB-msgv4

importing

message_text_output = g_ftext

exceptions

others = 1.

concatenate I_MSGTAB-msgid I_MSGTAB-msgnr g_ftext

into g_ftext separated by space.

endform. " get_error_message

thanks,

kallu