0% found this document useful (0 votes)
75 views1 page

PO For ZDPL

This document contains ABAP code for defining data objects and variables, assigning values to variables from internal tables, and performing conditional logic based on the values of variables and system fields. Key elements defined include internal tables, data objects for sales type, depot code, sales group, and a cursor field. Conditional logic is used to check values, select data, and display messages.

Uploaded by

supreeth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views1 page

PO For ZDPL

This document contains ABAP code for defining data objects and variables, assigning values to variables from internal tables, and performing conditional logic based on the values of variables and system fields. Key elements defined include internal tables, data objects for sales type, depot code, sales group, and a cursor field. Conditional logic is used to check values, select data, and display messages.

Uploaded by

supreeth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

DATA: lv_sales TYPE char1.

"S/D/M stores
DATA: lv_depotrp TYPE CHAR3. "Depot code
DATA: lv_salgrp TYPE CHAR3. "Territory code
DATA: IT_T001W TYPE TABLE OF T001W. "Internal table
DATA: IT_TVKGR TYPE TABLE OF TVKGR.
DATA: FLD TYPE char20.

lv_sales = VBKD-BSTKD+0(1).
lv_depotrp = VBKD-BSTKD+1(3).
lv_salgrp = VBKD-BSTKD+4(3).

IF SY-DYNNR = '0101' OR SY-DYNNR = '4413'. "Added by Saurabh on 19/11/2015


else.
get CURSOR FIELD FLD.
if sy-tcode = 'VA03' or sy-tcode = 'VA02' and sy-dynnr = '0102'.

ELSEif sy-tcode = 'VA01' or sy-tcode = 'VA02' and FLD = 'VBKD-BSTKD'.

IF VBAK-AUART = 'ZDPL' .
If VBKD-BSTKD IS INITIAL.
MESSAGE E021(ZSD01).
endif.

If lv_sales = 'S' or lv_sales = 'D' or lv_sales = 'M' or lv_sales = 's' or


lv_sales = 'd' or lv_sales = 'm'. "Added and changed by Saurabh on 13/11/2015
If lv_sales = 'S' or lv_sales = 's'. "Added and changed by Saurabh on
13/11/2015
FREE VBKD-BSTKD.
VBKD-BSTKD = 'SALES PERSON ON PHONE'.
ELSEIF lv_sales = 'D' or lv_sales = 'd'. "Added and changed by Saurabh on
13/11/2015
FREE VBKD-BSTKD.
VBKD-BSTKD = 'DEALER ON PHONE'.
ELSEIF lv_sales = 'M' or lv_sales = 'm'. "Added and changed by Saurabh on
13/11/2015

If lv_depotrp IS NOT INITIAL OR lv_salgrp IS NOT INITIAL.


SELECT * FROM T001W INTO TABLE IT_T001W WHERE WERKS EQ lv_depotrp.
If sy-subrc eq 0.
SELECT * FROM TVKGR INTO TABLE IT_TVKGR WHERE VKGRP EQ lv_salgrp.
If sy-subrc ne 0.
MESSAGE E034(ZSD01).
endif.
else.
MESSAGE E034(ZSD01).
endif.
endif.
ENDIF.
else.
MESSAGE E033(ZSD01).
ENDIF.
ENDIF.
ENDIF.
ENDIF.

You might also like