2007 Jan 02 5:51 AM
hi Data transfer gurus,
i m writing a bdc program for updating sales data (vao1)
frnds can anyone provide to logic for how to update the tax
for a paticular material .
If anyone having code they can mail me at [email protected]
thnking u all.
regards,
sanjay
2007 Jan 02 9:45 AM
Dear Sanjay,
The tax is maintained in the condition records for a condition type. A condition type is classified for taxes in the condition category in customization. During runtime screen-field KOMV-KNTYP shows the tax classification.
Regards,
Abir
***********************************
Don't forget to award points *
Dear Sanjay,
The tax is maintained in the condition records for a condition type. A condition type is classified for taxes in the condition category in customization. During runtime screen-field KOMV-KNTYP shows the tax classification.
Regards,
Abir
***********************************
Don't forget to award points *
2007 Jan 02 9:45 AM
Dear Sanjay,
The tax is maintained in the condition records for a condition type. A condition type is classified for taxes in the condition category in customization. During runtime screen-field KOMV-KNTYP shows the tax classification.
Regards,
Abir
***********************************
Don't forget to award points *
2007 Jan 04 3:35 AM
Hi Abir,
This is the code can u just correct me.
report ZTESTVA1 no standard page heading.
TABLES: KUAGV,
VBKD,
VBAK,
VBAP,
KONV,
RV61A.
DATA: BEGIN OF ITAB OCCURS 0,
AUART LIKE VBAK-AUART,
VKORG LIKE VBAK-VKORG,
VTWEG LIKE VBAK-VTWEG,
SPART LIKE VBAK-SPART,
KUNNR LIKE KUAGV-KUNNR,
FKDAT(10) TYPE C,
AUGRU LIKE VBAK-AUGRU,
MATNR LIKE VBAP-MATNR,
ZMENG LIKE VBAP-ZMENG,
KSCHL LIKE KOMV-KSCHL,
KBETR LIKE KOMV-KBETR,
END OF ITAB.
DATA: BEGIN OF ITAB_ITEM OCCURS 0,
MATNR LIKE VBAP-MATNR,
ZMENG LIKE VBAP-ZMENG,
KSCHL LIKE KOMV-KSCHL,
KBETR LIKE KOMV-KBETR,
END OF ITAB_ITEM.
DATA: BEGIN OF ITAB_FILE OCCURS 0,
END OF ITAB_FILE.
DATA: WRITE ITAB_KBETR TO IT_KBETR.
include bdcrecxx.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECTION-SCREEN BEGIN OF BLOCK B2A WITH FRAME TITLE TEXT-003.
PARAMETER: CB_PC AS CHECKBOX.
PARAMETER: P_PCFILE LIKE RLGRAP-FILENAME DEFAULT 'c:\temp\sorders.txt'.
SELECTION-SCREEN END OF BLOCK B2A.
SELECTION-SCREEN BEGIN OF BLOCK B2B WITH FRAME TITLE TEXT-004.
PARAMETER: CB_UX AS CHECKBOX.
PARAMETER: P_UFILE LIKE RLGRAP-FILENAME DEFAULT '/hqspool/sorders.txt'.
SELECTION-SCREEN END OF BLOCK B2B.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN.
IF CB_PC IS INITIAL AND CB_UX IS INITIAL.
MESSAGE E000(ZZ) WITH 'Choose one of the download Options.'.
ENDIF.
IF CB_PC = 'X' AND P_PCFILE IS INITIAL.
MESSAGE S000(ZZ) WITH 'Provide a PC filename.'.
ENDIF.
START-OF-SELECTION.
*TO UPLOAD DATA FROM THE PRESENTATION SERVER.
IF CB_PC = 'X'.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_PCFILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
IF SY-SUBRC = 0.
MESSAGE S000(ZZ) WITH P_PCFILE ' uploaded successfully.'.
ENDIF.
ENDIF.
TO UPLOAD THE FILE FROM THE APPLICATION SERVER.
IF CB_UX = 'X'.
OPEN DATASET P_UFILE FOR INPUT IN TEXT MODE.
IF SY-SUBRC NE 0.
MESSAGE E000(ZZ) WITH 'Unable to open the Unix File.'.
ENDIF.
DO.
READ DATASET P_UFILE INTO ITAB.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
APPEND ITAB.
ENDDO.
CLOSE DATASET P_UFILE.
ENDIF.
perform open_group.
LOOP AT ITAB.
REFRESH ITAB.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_OKCODE'
'ENT2'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-SPART'.
perform bdc_field using 'VBAK-AUART'
ITAB-AUART.
perform bdc_field using 'VBAK-VKORG'
ITAB-VKORG.
perform bdc_field using 'VBAK-VTWEG'
ITAB-VTWEG.
perform bdc_field using 'VBAK-SPART'
ITAB-SPART.
perform bdc_dynpro using 'SAPMV45A' '0415'.
perform bdc_field using 'BDC_OKCODE'
'ENT1'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUGRU'.
perform bdc_field using 'KUAGV-KUNNR'
ITAB-KUNNR.
perform bdc_field using 'VBKD-FKDAT'
ITAB-FKDAT.
perform bdc_field using 'VBAK-AUGRU'
ITAB-AUGRU.
perform bdc_field using 'VBAP-MATNR(01)'
''.
perform bdc_field using 'VBAP-ZMENG(01)'
''.
LOOP AT ITAB_ITEM.
REFRESH ITAB_ITEM.
perform bdc_dynpro using 'SAPMV45A' '0415'.
perform bdc_field using 'BDC_OKCODE'
'POAN'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-MATNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '0415'.
perform bdc_field using 'BDC_OKCODE'
'ENT1'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-ZMENG(01)'.
perform bdc_field using 'VBAP-MATNR(01)'
ITAB-MATNR.
perform bdc_field using 'VBAP-ZMENG(01)'
ITAB-ZMENG.
perform bdc_dynpro using 'SAPMV45A' '0415'.
perform bdc_field using 'BDC_OKCODE'
'POPO'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-MATNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '0251'.
perform bdc_field using 'BDC_OKCODE'
'POSI'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-POSNR'.
perform bdc_field using 'RV45A-POSNR'
'10'.
perform bdc_dynpro using 'SAPMV45A' '0415'.
perform bdc_field using 'BDC_OKCODE'
'PKON'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-MATNR(01)'.
perform bdc_dynpro using 'SAPMV61A' '0620'.
perform bdc_field using 'BDC_OKCODE'
'ENT1'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(4)'.
perform bdc_field using 'KOMV-KSCHL(4)'
ITAB-KSCHL.
perform bdc_field using 'KOMV-KBETR(4)'
ITAB-KBETR.
perform bdc_dynpro using 'SAPMV61A' '0620'.
perform bdc_field using 'BDC_OKCODE'
'ENT1'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(5)'.
perform bdc_field using 'KOMV-KSCHL(5)'
ITAB-KSCHL.
perform bdc_field using 'KOMV-KBETR(5)'
IT-KBETR.
perform bdc_dynpro using 'SAPMV61A' '0620'.
perform bdc_field using 'BDC_OKCODE'
'ENT1'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(6)'.
perform bdc_field using 'KOMV-KSCHL(6)'
ITAB-KSCHL.
perform bdc_field using 'KOMV-KBETR(6)'
ITAB-KBETR.
perform bdc_dynpro using 'SAPMV61A' '0620'.
perform bdc_field using 'BDC_OKCODE'
'ENT1'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(7)'.
perform bdc_field using 'KOMV-KSCHL(7)'
ITAB-KSCHL.
perform bdc_field using 'KOMV-KBETR(7)'
IT-KBETR.
ENDLOOP.
perform bdc_dynpro using 'SAPMV61A' '0620'.
perform bdc_field using 'BDC_OKCODE'
'BACK'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(01)'.
perform bdc_dynpro using 'SAPMV45A' '0415'.
perform bdc_field using 'BDC_OKCODE'
'SICH'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-FAKSK'.
perform bdc_field using 'VBAK-FAKSK'
''.
perform bdc_transaction using 'VA01'.
refresh bdcdata.
perform bdc_dynpro using 'SAPMV45A' '0102'.
perform bdc_field using 'BDC_OKCODE'
'ENT2'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-VBELN'.
perform bdc_dynpro using 'SAPMV45A' '0415'.
perform bdc_field using 'BDC_OKCODE'
'SICH'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-FAKSK'.
perform bdc_field using 'VBAK-FAKSK'
''.
perform bdc_transaction using 'VA02'.
perform close_group.
ENDLOOP.
help me regarding this.
regards,
sanjay
<b> NOTE : IF U HAV ANY DEFULT CODE PLZ SEND TO [email protected]</B>
2007 Jan 04 3:54 AM
Hi Sanjay
Please try to use BAPI for loading sales orders: <b>BAPI_SALESORDER_CREATEFROMDAT2</b>
Via this, we can easily handle, schedule lines, conditions...
Kind Regards
Eswar
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |