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

VA01

Former Member
0 Likes
780

hi all,

in flat file we have large volumes of data,so for tcode va01,how the item will get filled(tell me both the ways in table control and in normal BDC (call & session).

is there any page down,page up...

regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
734

HI Sri,

U need to use LOOP AT SCREEN to add line items .. page up and page down are not available in recording..

other method is...

Use Insert button to add new line item.

Regards

SAB

HI Sri,

U need to use LOOP AT SCREEN to add line items .. page up and page down are not available in recording..

other method is...

Use Insert button to add new line item.

Regards

SAB

5 REPLIES 5
Read only

Former Member
0 Likes
735

HI Sri,

U need to use LOOP AT SCREEN to add line items .. page up and page down are not available in recording..

other method is...

Use Insert button to add new line item.

Regards

SAB

Read only

0 Likes
734

hi,

Then where we us page up and page down(other than recording).

Read only

Former Member
0 Likes
734

Hi,

Use the BAPI BAPI_SALESDOCU_CREATEFROMDATA1 to create the sales order instead of using VA01..

Sample code.

-


PARAMETERS: p_auart TYPE auart OBLIGATORY.

PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.

PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.

PARAMETERS: p_spart TYPE vtweg OBLIGATORY.

PARAMETERS: p_sold TYPE kunnr OBLIGATORY.

PARAMETERS: p_ship TYPE kunnr OBLIGATORY.

*ITEM

PARAMETERS: p_matnr TYPE matnr OBLIGATORY.

PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.

PARAMETERS: p_plant TYPE werks_d OBLIGATORY.

PARAMETERS: p_itcat TYPE pstyv OBLIGATORY.

  • DATA DECLARATIONS.

DATA: v_vbeln LIKE vbak-vbeln.

DATA: header LIKE bapisdhead1.

DATA: headerx LIKE bapisdhead1x.

DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.

DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.

DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.

DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx

WITH HEADER LINE.

DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl

WITH HEADER LINE.

  • HEADER DATA

header-doc_type = p_auart.

headerx-doc_type = 'X'.

header-sales_org = p_vkorg.

headerx-sales_org = 'X'.

header-distr_chan = p_vtweg.

headerx-distr_chan = 'X'.

header-division = p_spart.

headerx-division = 'X'.

headerx-updateflag = 'I'.

  • PARTNER DATA

partner-partn_role = 'AG'.

partner-partn_numb = p_sold.

APPEND partner.

partner-partn_role = 'WE'.

partner-partn_numb = p_ship.

APPEND partner.

  • ITEM DATA

itemx-updateflag = 'I'.

item-itm_number = '000010'.

itemx-itm_number = 'X'.

item-material = p_matnr.

itemx-material = 'X'.

item-plant = p_plant.

itemx-plant = 'X'.

item-target_qty = p_menge.

itemx-target_qty = 'X'.

item-target_qu = 'EA'.

itemx-target_qu = 'X'.

item-item_categ = p_itcat.

itemx-item_categ = 'X'.

APPEND item.

APPEND itemx.

  • Fill schedule lines

lt_schedules_in-itm_number = '000010'.

lt_schedules_in-sched_line = '0001'.

lt_schedules_in-req_qty = p_menge.

APPEND lt_schedules_in.

  • Fill schedule line flags

lt_schedules_inx-itm_number = '000010'.

lt_schedules_inx-sched_line = '0001'.

lt_schedules_inx-updateflag = 'X'.

lt_schedules_inx-req_qty = 'X'.

APPEND lt_schedules_inx.

  • Call the BAPI

CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'

EXPORTING

sales_header_in = header

sales_header_inx = headerx

IMPORTING

salesdocument_ex = v_vbeln

TABLES

return = return

sales_items_in = item

sales_items_inx = itemx

sales_schedules_in = lt_schedules_in

sales_schedules_inx = lt_schedules_inx

sales_partners = partner.

  • Check the return table.

LOOP AT return WHERE type = 'E' OR type = 'A'.

EXIT.

ENDLOOP.

IF sy-subrc = 0.

WRITE: / 'Error in creating document'.

ELSE.

COMMIT WORK AND WAIT.

WRITE: / 'Document ', v_vbeln, ' created'.

ENDIF.

Thanks,

Naren

Read only

Former Member
0 Likes
734

Hi,

If you have multiple line items, use 'Create Item' button at the left botton of the screen to add Line Items. During the recording, capture the function code for that button i.e click on that button to add an item so that your BDC will work properly even if you have multiple Line Items.

Reward points if the answer is helpful.

Regards,

Mukul

Read only

Former Member
0 Likes
734

Hi,

Yes there is Page Down '=P+' and Page up '=P-' okcodes.

In addition you will also have to set some parameter values.

DATA: ctu_params_tmp LIKE ctu_params.

CLEAR: ctu_params_tmp.

ctu_params_tmp-dismode = 'N'.

ctu_params_tmp-updmode = 'S'.

ctu_params_tmp-defsize = 'X'.

CLEAR: messtab. REFRESH: messtab.

CALL TRANSACTION 'MB01' USING i_bdcdata3 OPTIONS

FROM ctu_params_tmp

MESSAGES INTO messtab.

Check the number of lines the table control has while you do a BDC, accordingly you will have to insert into the table control.

For eg: see the code which we have done for check posting. Generally only 13 lines will be visible in a table control when scheduled background:

CLEAR ws_c_field.

CONCATENATE '*PAYR-BANCD(' cnt_item ')' INTO ws_c_field.

PERFORM f_date_formatting

CHANGING i_segdata-z1cashdt.

PERFORM f0005_bdc_field USING ws_c_field

i_segdata-z1cashdt.

IF cnt_item GT '13'.

PERFORM f0005_bdc_field USING 'BDC_OKCODE'

'/00'. "Subbu

PERFORM f0004_bdc_dynpro USING 'SAPMFCHK' '0651'.

PERFORM f0005_bdc_field USING 'BDC_OKCODE'

'=P+'.

PERFORM f0004_bdc_dynpro USING 'SAPMFCHK' '0651'. "Subbu

PERFORM f0005_bdc_field USING 'BDC_OKCODE'

'/00'. "Subbu

cnt_item = c_01.

ELSE.

cnt_item = cnt_item + c_1.

ENDIF.

Regards

Subramanian