Can we recieve goods for purchase order with out material master data in PO
I have service PR for doing the services. I will give the material which is not accounted ( no material in the PO)and raise PO with reference to production order. but once the service is done,that product will become a material ( master data available) I have to receive the final product.Can we do the GR for this product. If so ,could you please explain the scenario
Hi Sankarkumar
When you are issuing the material for servicing your existing inventory for the material will be affected how you are plannignto handle that? You are receiving a different material once the serviceing is done then again yoour inventory will be affected for the new material. If you do not intend to issue material in SAP then why are you worried when you are bringing the new material into SAP after servicing is over? It is a subcontract scenario in a normal situation. But since you do not want then you can do a Service PO from the reqn and later use receipt without PO for bringing material in. Just speak to your finance guys how to set right the debit/credit amount resulted due to this transaction.
Regards
Sam
Similar Messages
-
Purchase requisition with out material master - options
Hi experts
I wish to establish a control in Purchase requisition that, when the user enters item with out material master record (only enters text), system should give a pop for decision options yes or no.
Please let me know the userexit useful to map this while saving the document.
regards
mariasHi
This userexit is specifically for Customers' Own Data in Purchase Requisition. we need to provide data. My scenario does not involve entry of new data and to verify the PR item data already entered.
regards
marias -
PURCHASE ORDER WITH OUT BAPI_PO_CREATE CAN WE CREATE?
PURCHASE ORDER WITH OUT calling BAPI_PO_CREATE CAN WE CREATE?
Don't Post your question with all Caps. Follow the Rules of Engagement
Edited by: Vijay Babu Dudla on Apr 23, 2009 1:46 AM[Create Purchase order with program|can we create purchase order through report programming?]
Plz be clear about your requirement instead of posting questions like these.
Don't violate forum rules with Duplicate posts -
How can i sign up for hbo now with out ipad
how can i sign up for hbo now with out ipad
You need an Apple TV or iOS device. See this link. http://www.apple.com/appletv/hbo-now/
-
LSMW - Purchase Order Text in Material Master
All MM Experts,
I tired to create simple Batch Input Recording but the screen does not get recorded for Purchase Order text maintenance in mass for article master data. we are maintaining Purchase Order Text in article master data in basic data screen on additional data button under purchase order text tab.
Any suggestion on creating LSMW for purchase order text.LSMW has a standard direct input for long texts, hence it is not necessary to do a recording.
help.sap.com gives real good help for loading loading long texts with LSMW, further has this been discussed many many times here in MM and in the data migration forum.
try to search a bit, you dont really need more than the words you already have used on the subject to get a good variety of answers -
View "Purchase Order Text" in Material Master
Hi,
I need replicated text of view "Purchase Order Text" in ECC to Material Master in SRM.
Or When We create a shopping cart in the way in which the text replicated "Purchase Order Text" from the the Material Master(ECC).
Regards
AngieFor Purchase Order text in Material Master:
use this code for Purchase Order text,
DATA: l_lsize(3) TYPE n VALUE '132'.
DATA: lwa_tline TYPE tline,
lwa_thead TYPE thead,
lwa_valid TYPE ty_input(flat file data),
lwa_temp TYPE ty_input.
DATA: lit_tline TYPE STANDARD TABLE OF tline.
lwa_thead-tdobject = 'MATERIAL'.
lwa_thead-tdid = 'BEST'.
lwa_thead-tdspras = 'E'.
lwa_thead-tdlinesize = l_lsize.
LOOP AT pu_it_valid INTO lwa_valid.
lwa_temp = lwa_valid.
AT NEW matnr.
CLEAR: lwa_thead-tdname,
lwa_tline-tdformat.
lwa_thead-tdname = lwa_temp-matnr.
ENDAT.
IF lwa_tline-tdformat IS INITIAL.
lwa_tline-tdformat = ' \ '.
ELSE.
lwa_tline-tdformat = '='.
ENDIF.
CLEAR lwa_tline-tdline.
lwa_tline-tdline = lwa_valid-text_line.
APPEND lwa_tline TO lit_tline.
AT END OF matnr.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = lwa_thead
insert = c_x
savemode_direct = c_x
TABLES
lines = lit_tline
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc = 0.
REFRESH lit_tline.
ENDIF.
ENDAT.
CLEAR: lwa_temp,
lwa_valid.
ENDLOOP. -
What is procedure for creating new vendor and material master data in ABAP
What is procedure for creating new vendor and material master data in ABAP .
see below code which is used for creation of vendor master as well as extension...
*& Report ZFC_VENDOR_CREATE *
REPORT ZFC_VENDOR_CREATE LINE-SIZE 100
NO STANDARD PAGE HEADING
MESSAGE-ID ZZ.
TABLES
TABLES : SSCRFIELDS. " Fields on selection screens
CONSTANTS
DATA : C_SPLIT TYPE C VALUE '#'. " Used for Has Separator in GUI_UPLAOD
TYPES
Int'table to hold Vendor Master Data
TYPES : BEGIN OF TY_VENDOR_MASTER,
FLAG TYPE C, " Update Flag
LIFNR TYPE LIFNR, " Vendor Number
BUKRS TYPE BUKRS, " Company Code
KTOKK TYPE KTOKK, " Account Group
ANRED TYPE ANRED, " Title
NAME1 TYPE NAME1_GP, " Name1
NAME2 TYPE NAME2_GP, " Name2
SORTL TYPE SORTL, " Search Term 1
SORT2 TYPE AD_SORT2UL, " Search Term 2
STRAS TYPE STRAS_GP, " Street
PSTLZ TYPE PSTLZ, " Postal Code
ORT01 TYPE ORT01_GP, " City
REGIO TYPE REGIO, " Region
LAND1 TYPE LAND1_GP, " Country
SPRAS TYPE SPRAS, " Language
VBUND TYPE RASSC, " Trading Partner
BANKS TYPE BANKS, " Country
BANKL TYPE BANKK, " Bank Key
BANKN TYPE BANKN, " Bank Account
BKONT TYPE BKONT, " Bank Control Key
BANKA TYPE BANKA, " Name of Bank
AKONT TYPE AKONT, " Reconciliation Account
FDGRV TYPE FDGRV, " Cash Management Group
ZTERM TYPE DZTERM, " Payment Terms
REPRF TYPE REPRF, " Check Double Invoice
ZWELS TYPE DZWELS, " Payment Methods
XPORE TYPE XPORE, " Pay all items separately
END OF TY_VENDOR_MASTER,
Int'table to hold Vendor Extend Data
BEGIN OF TY_VENDOR_EXTEND,
FLAG TYPE C, " Update Flag
LIFNR TYPE LIFNR, " Vendor Number
BUKRS TYPE BUKRS, " Company Code
KTOKK TYPE KTOKK, " Account Group
REF_LIFNR TYPE LIFNR, " Reference Vendor Number
REF_BUKRS TYPE BUKRS, " Reference Company Code
AKONT TYPE AKONT, " Reconciliation Account
FDGRV TYPE FDGRV, " Cash Management Group
ZTERM TYPE DZTERM, " Payment Terms
REPRF TYPE REPRF, " Check Double Invoice
ZWELS TYPE DZWELS, " Payment Methods
XPORE TYPE XPORE, " Pay all items separately
END OF TY_VENDOR_EXTEND,
Int'table to hold Error Records Data
BEGIN OF TY_ERROR,
MSG(200) TYPE C, " To hold Message
LIFNR TYPE LIFNR, " Vendor Number
BUKRS TYPE BUKRS, " Company Code
END OF TY_ERROR.
DATA (Simple Fields)
DATA : W_COUNT TYPE I, " Variable to hold count of Records
W_SUCC_REC TYPE I, " No. of Success Records
W_SUCC_REC1 TYPE I, " No. of Updated Records
W_ERR_REC TYPE I, " No. of Error Records
w_noupdate_rec type i. " No. of Records not Changed
INTERNAL TABLES
Int'table to hold uploaded data from File
DATA : IT_VENDOR_MASTER TYPE STANDARD TABLE OF TY_VENDOR_MASTER,
WA_IT_VENDOR_MASTER TYPE TY_VENDOR_MASTER,
IT_VENDOR_EXTEND TYPE STANDARD TABLE OF TY_VENDOR_EXTEND,
WA_IT_VENDOR_EXTEND TYPE TY_VENDOR_EXTEND,
WA_IT_BDCDATA TYPE BDCDATA,
IT_BDCDATA TYPE STANDARD TABLE OF BDCDATA,
WA_IT_MESSTAB TYPE BDCMSGCOLL,
IT_MESSTAB TYPE STANDARD TABLE OF BDCMSGCOLL,
IT_ERROR TYPE STANDARD TABLE OF TY_ERROR,
WA_IT_ERROR TYPE TY_ERROR,
it_error_fk01 type standard table of ty_error,
wa_it_error_fk01 type ty_error,
it_error_fk02 type standard table of ty_error,
wa_it_error_fk02 type ty_error,
it_succ_rec1 type standard table of ty_error,
wa_it_succ_rec1 type ty_error,
it_noupdate type standard table of ty_error,
wa_it_noupdate type ty_error.
FLAGS
DATA : FL_FLAG1 TYPE C, " Flag to check error upload file
FL_FLAG2 TYPE C, " Flag to hold value
FL_FLAG3 TYPE C, " Flag to hold value
FL_FLAG4 TYPE C. " Flag to hold value
SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-001,
POSITION POS_LOW.
PARAMETERS : P_FILE(128) DEFAULT 'C:\UPLOAD.TXT' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-002,
POSITION POS_LOW.
PARAMETERS : P_VENMAS RADIOBUTTON GROUP R1 DEFAULT 'X'.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-003,
POSITION POS_LOW.
PARAMETERS : P_VENEXT RADIOBUTTON GROUP R1.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-004,
POSITION POS_LOW.
PARAMETERS : P_MODE(1) DEFAULT 'N'.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-005,
POSITION POS_LOW.
PARAMETERS : P_GROUP(12) DEFAULT 'ZFC_VENDOR_C' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-016,
POSITION POS_LOW.
PARAMETERS : P_GROUP1(12) DEFAULT 'ZFC_VENDOR_U' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
Form to get file path for upload of data
PERFORM GET_FILE_PATH.
AT SELECTION-SCREEN ON BLOCK B1.
Form to Validate data specified on Selection Screen
CHECK SSCRFIELDS-UCOMM EQ 'ONLI'.
PERFORM VALIDATE_DATA.
START - OF - SELECTION
START-OF-SELECTION.
IF P_VENMAS = 'X'.
Form to upload data from Presentation Server for Vendor Master
PERFORM UPLOAD_DATA TABLES IT_VENDOR_MASTER.
IF FL_FLAG1 NE 'X'.
SORT IT_VENDOR_MASTER BY LIFNR BUKRS KTOKK.
DELETE IT_VENDOR_MASTER WHERE LIFNR = ' '
AND BUKRS = ' '
AND KTOKK = ' '.
Form to process data for Vendor Master
PERFORM INSERT_VENDOR_MASTER_DATA.
ENDIF.
ELSEIF P_VENEXT = 'X'.
Form to upload data from Presentation Server for Vendor Extend
PERFORM UPLOAD_DATA TABLES IT_VENDOR_EXTEND.
IF FL_FLAG1 NE 'X'.
SORT IT_VENDOR_EXTEND BY LIFNR BUKRS KTOKK.
DELETE IT_VENDOR_EXTEND WHERE LIFNR = ' '
AND BUKRS = ' '
AND KTOKK = ' '.
Form to process data for Vendor Master
PERFORM CHK_AND_INS_VENDOR_EXTEND_DATA.
ENDIF.
ENDIF.
END - OF - SELECTION
END-OF-SELECTION.
IF FL_FLAG1 NE 'X'.
FORMAT COLOR 7.
WRITE:/2 TEXT-O01. " Total Number of records read :
FORMAT COLOR OFF.
WRITE:40 W_COUNT.
FORMAT COLOR 7.
WRITE:/2 TEXT-O02. " Total Number of Success records :
FORMAT COLOR OFF.
WRITE:40 W_SUCC_REC.
FORMAT COLOR 7.
WRITE:/2 TEXT-O07. " Total Number of Updated records :
FORMAT COLOR OFF.
WRITE:40 W_SUCC_REC1.
FORMAT COLOR 7.
WRITE:/2 TEXT-O08. " Total Number of Unchanged records :
FORMAT COLOR OFF.
WRITE:40 W_noupdate_REC.
FORMAT COLOR 7.
WRITE:/2 TEXT-O03. " Total Number of Error records :
FORMAT COLOR OFF.
WRITE:40 W_ERR_REC.
if not it_succ_rec1 is initial.
skip 1.
perform display_changed_report.
endif.
if not it_noupdate is initial.
skip 1.
perform display_nochange_report.
endif.
IF NOT IT_ERROR IS INITIAL.
SKIP 3.
Form to display error data
PERFORM DISPLAY_ERROR_REPORT.
ENDIF.
IF FL_FLAG2 = 'X'.
SKIP 2.
FORMAT COLOR 4.
WRITE:/2 TEXT-O04. " BDC Session Name for Creation (FK01) :
FORMAT COLOR OFF.
WRITE:40 P_GROUP.
perform display_error_report_fk01.
ENDIF.
IF FL_FLAG3 = 'X'.
SKIP 2.
FORMAT COLOR 4.
WRITE:/2 TEXT-O09. " BDC Session Name for Updation (FK02) :
FORMAT COLOR OFF.
WRITE:40 P_GROUP1.
perform display_error_report_fk02.
ENDIF.
ENDIF.
*& Form GET_FILE_PATH
This form is used to get the specified path for uploading of data from
flat file with the help of F4 function key
FORM GET_FILE_PATH .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FILE.
ENDFORM. " GET_FILE_PATH
*& Form VALIDATE_DATA
This form is used to validate the data given by user on the Selection
Screen and the appropriate message is been displayed when an wrong
entry is inputted
FORM VALIDATE_DATA .
IF SY-BATCH EQ 'X'.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E001(ZZ) WITH TEXT-011.
" Excel file not to be used in Batch Mode
ENDIF.
IF P_MODE NE 'A' AND P_MODE NE 'N' AND P_MODE NE 'E'.
MESSAGE E001(ZZ) WITH TEXT-012.
" Session Mode should be either A or N or E
ENDIF.
ENDFORM. " VALIDATE_DATA
*& Form UPLOAD_DATA
This form is used to upload data from Presentation Server for either
Vendor Master or Vendor Extend
FORM UPLOAD_DATA TABLES P_IT_VENDOR.
DATA : L_FILENAME TYPE STRING,
L_FILETYPE TYPE CHAR10 VALUE 'ASC',
L_HEADER_LENGTH TYPE I VALUE 0,
L_READ_BY_LINE TYPE CHAR01 VALUE 'X'.
MOVE P_FILE TO L_FILENAME.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FILENAME
FILETYPE = L_FILETYPE
HEADER_LENGTH = L_HEADER_LENGTH
READ_BY_LINE = L_READ_BY_LINE
HAS_FIELD_SEPARATOR = C_SPLIT
TABLES
DATA_TAB = P_IT_VENDOR
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
IF SY-SUBRC <> 0.
MESSAGE I001(ZZ) WITH TEXT-006 L_FILENAME.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
FL_FLAG1 = 'X'.
ELSEIF P_IT_VENDOR[] IS INITIAL.
MESSAGE I001(ZZ) WITH TEXT-014. " Uploaded File contains no data
FL_FLAG1 = 'X'.
ENDIF.
ENDFORM. " UPLOAD_DATA
*& Form INSERT_VENDOR_MASTER_DATA
This form is used to process BDC data for Vendor Master
FORM INSERT_VENDOR_MASTER_DATA .
DATA : L_LIFNR TYPE LIFNR.
CLEAR : L_LIFNR.
sort it_vendor_master by flag.
LOOP AT IT_VENDOR_MASTER INTO WA_IT_VENDOR_MASTER.
W_COUNT = W_COUNT + 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_MASTER-LIFNR
IMPORTING
OUTPUT = WA_IT_VENDOR_MASTER-LIFNR.
if wa_it_vendor_master-flag = 'A'.
SELECT SINGLE LIFNR
FROM LFB1
INTO L_LIFNR
WHERE LIFNR = WA_IT_VENDOR_MASTER-LIFNR
AND BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
IF SY-SUBRC EQ 0.
WA_IT_ERROR-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_ERROR-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
WA_IT_ERROR-MSG = TEXT-015.
APPEND WA_IT_ERROR TO IT_ERROR.
W_ERR_REC = W_ERR_REC + 1.
CLEAR : WA_IT_ERROR, L_LIFNR.
ELSE.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
PERFORM POPULATE_BDC_DATA_VEN_MASTER.
PERFORM CALL_TRANSACTION.
ENDIF.
CLEAR : WA_IT_VENDOR_MASTER.
elseif wa_it_vendor_master-flag = 'C'.
IF FL_FLAG2 = 'X' and fl_flag4 ne 'X'.
PERFORM CLOSE_BDC_SESSION.
fl_flag4 = 'X'.
ENDIF.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
PERFORM POPULATE_BDC_DATA_VEN_MASTER.
PERFORM CALL_TRANSACTION_FK02.
CLEAR : WA_IT_VENDOR_MASTER.
elseif wa_it_vendor_master-flag = 'N'.
WA_IT_noupdate-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_noupdate-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
WA_IT_noupdate-MSG = TEXT-018.
APPEND WA_IT_noupdate TO IT_noupdate.
W_noupdate_REC = W_noupdate_REC + 1.
CLEAR : WA_IT_noupdate, WA_IT_VENDOR_MASTER.
endif.
ENDLOOP.
IF FL_FLAG3 = 'X'.
PERFORM CLOSE_BDC_SESSION.
ENDIF.
ENDFORM. " INSERT_VENDOR_MASTER_DATA
*& Form POPULATE_BDC_DATA_VEN_MASTER
This form is used to populate BDC data of Vendor Master
FORM POPULATE_BDC_DATA_VEN_MASTER .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_MASTER-ZTERM
IMPORTING
OUTPUT = WA_IT_VENDOR_MASTER-ZTERM.
IF WA_IT_VENDOR_MASTER-REPRF = 'Y'.
WA_IT_VENDOR_MASTER-REPRF = 'X'.
ENDIF.
IF WA_IT_VENDOR_MASTER-XPORE = 'Y'.
WA_IT_VENDOR_MASTER-XPORE = 'X'.
ENDIF.
if wa_it_vendor_master-flag = 'A'.
PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0105',
BDC_FIELD USING 'RF02K-LIFNR' WA_IT_VENDOR_MASTER-LIFNR,
BDC_FIELD USING 'RF02K-BUKRS' WA_IT_VENDOR_MASTER-BUKRS,
BDC_FIELD USING 'RF02K-KTOKK' WA_IT_VENDOR_MASTER-KTOKK,
BDC_FIELD USING 'BDC_OKCODE' '/00'.
elseif wa_it_vendor_master-flag = 'C'.
PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0106',
BDC_FIELD USING 'RF02K-LIFNR' WA_IT_VENDOR_MASTER-LIFNR,
BDC_FIELD USING 'RF02K-BUKRS' WA_IT_VENDOR_MASTER-BUKRS,
BDC_FIELD USING 'BDC_OKCODE' '=MALL',
BDC_DYNPRO USING 'SAPMF02K' '0106',
BDC_FIELD USING 'RF02K-D0110' 'X',
BDC_FIELD USING 'RF02K-D0120' 'X',
BDC_FIELD USING 'RF02K-D0130' 'X',
BDC_FIELD USING 'RF02K-D0210' 'X',
BDC_FIELD USING 'RF02K-D0215' 'X',
BDC_FIELD USING 'RF02K-D0220' 'X',
BDC_FIELD USING 'BDC_OKCODE' '/00'.
endif.
perform :BDC_DYNPRO USING 'SAPMF02K' '0110',
BDC_FIELD USING 'LFA1-ANRED' WA_IT_VENDOR_MASTER-ANRED,
BDC_FIELD USING 'LFA1-NAME1' WA_IT_VENDOR_MASTER-NAME1,
BDC_FIELD USING 'LFA1-NAME2' WA_IT_VENDOR_MASTER-NAME2,
BDC_FIELD USING 'LFA1-SORTL' WA_IT_VENDOR_MASTER-SORTL,
BDC_FIELD USING 'LFA1-STRAS' WA_IT_VENDOR_MASTER-STRAS,
BDC_FIELD USING 'LFA1-ORT01' WA_IT_VENDOR_MASTER-ORT01,
BDC_FIELD USING 'LFA1-PSTLZ' WA_IT_VENDOR_MASTER-PSTLZ,
BDC_FIELD USING 'LFA1-LAND1' WA_IT_VENDOR_MASTER-LAND1,
BDC_FIELD USING 'LFA1-REGIO' WA_IT_VENDOR_MASTER-REGIO,
BDC_FIELD USING 'LFA1-SPRAS' WA_IT_VENDOR_MASTER-SPRAS,
BDC_FIELD USING 'BDC_OKCODE' '/00',
BDC_DYNPRO USING 'SAPMF02K' '0120',
BDC_FIELD USING 'LFA1-VBUND' WA_IT_VENDOR_MASTER-VBUND,
BDC_FIELD USING 'BDC_OKCODE' '/00',
BDC_DYNPRO USING 'SAPMF02K' '0130',
BDC_FIELD USING 'LFBK-BANKS(01)' WA_IT_VENDOR_MASTER-BANKS,
BDC_FIELD USING 'LFBK-BANKL(01)' WA_IT_VENDOR_MASTER-BANKL,
BDC_FIELD USING 'LFBK-BANKN(01)' WA_IT_VENDOR_MASTER-BANKN,
BDC_FIELD USING 'BDC_OKCODE' '=BANK',
BDC_DYNPRO USING 'SAPLBANK' '0100',
BDC_FIELD USING 'BNKA-BANKA' WA_IT_VENDOR_MASTER-BANKA,
BDC_FIELD USING 'BDC_OKCODE' '=ENTR',
BDC_DYNPRO USING 'SAPMF02K' '0130',
BDC_FIELD USING 'BDC_OKCODE' '=ENTR',
BDC_DYNPRO USING 'SAPMF02K' '0210',
BDC_FIELD USING 'LFB1-AKONT' WA_IT_VENDOR_MASTER-AKONT,
BDC_FIELD USING 'LFB1-FDGRV' WA_IT_VENDOR_MASTER-FDGRV,
BDC_FIELD USING 'BDC_OKCODE' '=/00',
BDC_DYNPRO USING 'SAPMF02K' '0215',
BDC_FIELD USING 'LFB1-ZTERM' WA_IT_VENDOR_MASTER-ZTERM,
BDC_FIELD USING 'LFB1-REPRF' WA_IT_VENDOR_MASTER-REPRF,
BDC_FIELD USING 'LFB1-ZWELS' WA_IT_VENDOR_MASTER-ZWELS,
BDC_FIELD USING 'LFB1-XPORE' WA_IT_VENDOR_MASTER-XPORE,
BDC_FIELD USING 'BDC_OKCODE' '=UPDA'.
ENDFORM. " POPULATE_BDC_DATA_VEN_MASTER
*& Form BDC_DYNPRO
This form is used to move data to BDCDATA int'table
FORM BDC_DYNPRO USING PROGRAM TYPE BDC_PROG
DYNPRO TYPE BDC_DYNR.
CLEAR WA_IT_BDCDATA.
WA_IT_BDCDATA-PROGRAM = PROGRAM.
WA_IT_BDCDATA-DYNPRO = DYNPRO.
WA_IT_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_IT_BDCDATA TO IT_BDCDATA.
ENDFORM. " BDC_DYNPRO
*& Form BDC_FIELD
This form is used to move data to BDCDATA int'table
FORM BDC_FIELD USING FNAM TYPE ANY
FVAL TYPE ANY.
CLEAR WA_IT_BDCDATA.
WA_IT_BDCDATA-FNAM = FNAM.
WA_IT_BDCDATA-FVAL = FVAL.
APPEND WA_IT_BDCDATA TO IT_BDCDATA.
ENDFORM. " BDC_FIELD
*& Form CALL_TRANSACTION
This form is used to Call FK01 for processing of data either for
Vendor Master or Vendor Extend. The error records are inserted to
Session which can be processed using SM35
FORM CALL_TRANSACTION .
DATA : L_OPTION TYPE CTU_PARAMS,
L_SUBRC TYPE SYSUBRC.
REFRESH IT_MESSTAB.
CLEAR IT_MESSTAB.
L_OPTION-DEFSIZE = 'X'.
L_OPTION-DISMODE = P_MODE.
L_OPTION-UPDMODE = 'S'.
CALL TRANSACTION 'FK01'
USING IT_BDCDATA
MESSAGES INTO IT_MESSTAB
OPTIONS FROM L_OPTION.
L_SUBRC = SY-SUBRC.
IF L_SUBRC = 0.
W_SUCC_REC = W_SUCC_REC + 1.
ELSE.
IF FL_FLAG2 NE 'X'.
PERFORM OPEN_BDC_SESSION.
FL_FLAG2 = 'X'.
ENDIF.
PERFORM BDC_INSERT.
W_ERR_REC = W_ERR_REC + 1.
PERFORM ERROR_RECORD_DATA.
ENDIF.
ENDFORM. " CALL_TRANSACTION
*& Form OPEN_BDC_SESSION
Form used to open session for Error out Records
FORM OPEN_BDC_SESSION .
DATA : L_USERID TYPE APQ_MAPN, " Variable to hold user-id
L_GROUP TYPE APQ_GRPN. " Variable to hold value
MOVE P_GROUP TO L_GROUP.
MOVE SY-UNAME TO L_USERID.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = L_GROUP
KEEP = SPACE
USER = L_USERID
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-008. " Unable to open BDC Session
ENDIF.
ENDFORM. " OPEN_BDC_SESSION
*& Form BDC_INSERT
This form is used to insert error records to a Session method
FORM BDC_INSERT .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'FK01'
TABLES
DYNPROTAB = IT_BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-009. " Unable to Insert Data to BDC Session
ENDIF.
ENDFORM. " BDC_INSERT
*& Form ERROR_RECORD_DATA
This form is used to process the messages for the error records which
will be displayed on the output report
FORM ERROR_RECORD_DATA .
DATA : L_LINES TYPE I,
L_MSG(200) TYPE C.
DESCRIBE TABLE IT_MESSTAB LINES L_LINES.
READ TABLE IT_MESSTAB INTO WA_IT_MESSTAB INDEX L_LINES.
IF SY-SUBRC = 0.
CLEAR L_MSG.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_IT_MESSTAB-MSGID
LANG = SY-LANGU
NO = WA_IT_MESSTAB-MSGNR
V1 = WA_IT_MESSTAB-MSGV1
V2 = WA_IT_MESSTAB-MSGV2
V3 = WA_IT_MESSTAB-MSGV3
V4 = WA_IT_MESSTAB-MSGV4
IMPORTING
MSG = L_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WA_IT_ERROR_fk01-MSG = L_MSG.
ENDIF.
IF P_VENMAS = 'X'.
WA_IT_ERROR_fk01-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_ERROR_fk01-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
ELSEIF P_VENEXT = 'X'.
WA_IT_ERROR_fk01-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
WA_IT_ERROR_fk01-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
ENDIF.
APPEND WA_IT_ERROR_fk01 TO IT_ERROR_fk01.
CLEAR WA_IT_ERROR_fk01.
ENDIF.
ENDFORM. " ERROR_RECORD_DATA
*& Form CLOSE_BDC_SESSION
Form used to close session of the Error Records
FORM CLOSE_BDC_SESSION .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-010. " Unable to Close BDC Session
ENDIF.
ENDFORM. " CLOSE_BDC_SESSION
*& Form CHK_AND_INS_VENDOR_EXTEND_DATA
This form is used to process BDC data for Vendor Extend
FORM CHK_AND_INS_VENDOR_EXTEND_DATA .
DATA : L_LIFNR TYPE LIFNR.
CLEAR : L_LIFNR, fl_flag4.
sort it_vendor_extend by flag.
LOOP AT IT_VENDOR_EXTEND INTO WA_IT_VENDOR_EXTEND.
W_COUNT = W_COUNT + 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_EXTEND-REF_LIFNR
IMPORTING
OUTPUT = WA_IT_VENDOR_EXTEND-REF_LIFNR.
if wa_it_vendor_extend-flag = 'A'.
SELECT SINGLE LIFNR
FROM LFB1
INTO L_LIFNR
WHERE LIFNR = WA_IT_VENDOR_EXTEND-REF_LIFNR
AND BUKRS = WA_IT_VENDOR_EXTEND-REF_BUKRS.
IF SY-SUBRC NE 0.
WA_IT_ERROR-LIFNR = WA_IT_VENDOR_EXTEND-REF_LIFNR.
WA_IT_ERROR-BUKRS = WA_IT_VENDOR_EXTEND-REF_BUKRS.
WA_IT_ERROR-MSG = TEXT-007.
APPEND WA_IT_ERROR TO IT_ERROR.
W_ERR_REC = W_ERR_REC + 1.
CLEAR : WA_IT_ERROR, L_LIFNR.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_EXTEND-LIFNR
IMPORTING
OUTPUT = WA_IT_VENDOR_EXTEND-LIFNR.
SELECT SINGLE LIFNR
FROM LFB1
INTO L_LIFNR
WHERE LIFNR = WA_IT_VENDOR_EXTEND-LIFNR
AND BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
IF SY-SUBRC EQ 0.
WA_IT_ERROR-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
WA_IT_ERROR-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
WA_IT_ERROR-MSG = TEXT-015.
APPEND WA_IT_ERROR TO IT_ERROR.
W_ERR_REC = W_ERR_REC + 1.
CLEAR : WA_IT_ERROR, L_LIFNR.
ELSE.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
PERFORM POPULATE_BDC_DATA_VEN_EXTEND.
PERFORM CALL_TRANSACTION.
ENDIF.
ENDIF.
CLEAR : WA_IT_VENDOR_EXTEND.
elseif wa_it_vendor_extend-flag = 'C'.
IF FL_FLAG2 = 'X' and fl_flag4 ne 'X'.
PERFORM CLOSE_BDC_SESSION.
fl_flag4 = 'X'.
ENDIF.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
PERFORM POPULATE_BDC_DATA_VEN_extend.
PERFORM CALL_TRANSACTION_FK02.
CLEAR : WA_IT_VENDOR_EXTEND.
elseif wa_it_vendor_extend-flag = 'N'.
WA_IT_noupdate-LIFNR = WA_IT_VENDOR_extend-LIFNR.
WA_IT_noupdate-BUKRS = WA_IT_VENDOR_extend-BUKRS.
WA_IT_noupdate-MSG = TEXT-019.
APPEND WA_IT_noupdate TO IT_noupdate.
W_noupdate_REC = W_noupdate_REC + 1.
CLEAR : WA_IT_noupdate, WA_IT_VENDOR_EXTEND.
endif.
ENDLOOP.
IF FL_FLAG2 = 'X'.
PERFORM CLOSE_BDC_SESSION.
ENDIF.
if fl_flag3 = 'X'.
PERFORM CLOSE_BDC_SESSION.
ENDIF.
ENDFORM. " CHK_AND_INS_VENDOR_EXTEND_DATA
*& Form POPULATE_BDC_DATA_VEN_EXTEND
This form is used to populate BDC data of Vendor Extend
FORM POPULATE_BDC_DATA_VEN_EXTEND .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_EXTEND-ZTERM
IMPORTING
OUTPUT = WA_IT_VENDOR_EXTEND-ZTERM.
IF WA_IT_VENDOR_EXTEND-REPRF = 'Y'.
WA_IT_VENDOR_EXTEND-REPRF = 'X'.
ENDIF.
IF WA_IT_VENDOR_extend-XPORE = 'Y'.
WA_IT_VENDOR_extend-XPORE = 'X'.
ENDIF.
if wa_it_vendor_extend-flag = 'A'.
PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0105',
BDC_FIELD USING 'RF02K-LIFNR' WA_IT_VENDOR_EXTEND-LIFNR,
BDC_FIELD USING 'RF02K-BUKRS' WA_IT_VENDOR_EXTEND-BUKRS,
BDC_FIELD USING 'RF02K-KTOKK' WA_IT_VENDOR_EXTEND-KTOKK,
BDC_FIELD USING 'RF02K-REF_LIFNR'
WA_IT_VENDOR_EXTEND-REF_LIFNR,
BDC_FIELD USING 'RF02K-REF_BUKRS'
WA_IT_VENDOR_EXTEND-REF_BUKRS,
BDC_FIELD USING 'BDC_OKCODE' '/00'.
elseif wa_it_vendor_extend-flag = 'C'.
PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0106',
BDC_FIELD USING 'RF02K-LIFNR' WA_IT_VENDOR_extend-LIFNR,
BDC_FIELD USING 'RF02K-BUKRS' WA_IT_VENDOR_extend-BUKRS,
BDC_FIELD USING 'RF02K-D0210' 'X',
BDC_FIELD USING 'RF02K-D0215' 'X',
BDC_FIELD USING 'BDC_OKCODE' '/00'.
endif.
perform :BDC_DYNPRO USING 'SAPMF02K' '0210',
BDC_FIELD USING 'LFB1-AKONT' WA_IT_VENDOR_EXTEND-AKONT,
BDC_FIELD USING 'LFB1-FDGRV' WA_IT_VENDOR_EXTEND-FDGRV,
BDC_FIELD USING 'BDC_OKCODE' '=/00',
BDC_DYNPRO USING 'SAPMF02K' '0215',
BDC_FIELD USING 'LFB1-ZTERM' WA_IT_VENDOR_EXTEND-ZTERM,
BDC_FIELD USING 'LFB1-REPRF' WA_IT_VENDOR_EXTEND-REPRF,
BDC_FIELD USING 'LFB1-ZWELS' WA_IT_VENDOR_EXTEND-ZWELS,
BDC_FIELD USING 'LFB1-XPORE' WA_IT_VENDOR_extend-XPORE,
BDC_FIELD USING 'BDC_OKCODE' '=UPDA'.
ENDFORM. " POPULATE_BDC_DATA_VEN_EXTEND
*& Form DISPLAY_ERROR_REPORT
This form is used to display the error records on the output screen
FORM DISPLAY_ERROR_REPORT .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O05. " Error List for Vendor Master
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O06. " Error List for Vendor Master Extended
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
17 SY-VLINE,
18 TEXT-H02, " Company Code
31 SY-VLINE,
32 TEXT-H03, " Error Message
100 SY-VLINE.
FORMAT COLOR OFF.
WRITE:/ SY-ULINE(100).
LOOP AT IT_ERROR INTO WA_IT_ERROR.
FORMAT COLOR 2.
WRITE:/1 SY-VLINE,
2 WA_IT_ERROR-LIFNR,
17 SY-VLINE,
18 WA_IT_ERROR-BUKRS,
31 SY-VLINE,
32 WA_IT_ERROR-MSG,
100 SY-VLINE.
CLEAR : WA_IT_ERROR.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/ SY-ULINE(100).
ENDFORM. " DISPLAY_ERROR_REPORT
*& Form CALL_TRANSACTION_FK02
Form used to Call Transaction FK02
form CALL_TRANSACTION_FK02 .
DATA : L_OPTION TYPE CTU_PARAMS,
L_SUBRC TYPE SYSUBRC.
REFRESH IT_MESSTAB.
CLEAR IT_MESSTAB.
L_OPTION-DEFSIZE = 'X'.
L_OPTION-DISMODE = P_MODE.
L_OPTION-UPDMODE = 'S'.
CALL TRANSACTION 'FK02'
USING IT_BDCDATA
MESSAGES INTO IT_MESSTAB
OPTIONS FROM L_OPTION.
L_SUBRC = SY-SUBRC.
IF L_SUBRC = 0.
W_SUCC_REC1 = W_SUCC_REC1 + 1.
WA_IT_succ_rec1-MSG = Text-017.
IF P_VENMAS = 'X'.
WA_IT_succ_rec1-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_succ_rec1-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
ELSEIF P_VENEXT = 'X'.
WA_IT_succ_rec1-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
WA_IT_succ_rec1-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
ENDIF.
APPEND WA_IT_succ_rec1 TO IT_succ_rec1.
ELSE.
IF FL_FLAG3 NE 'X'.
PERFORM OPEN_BDC_SESSION_fk02.
FL_FLAG3 = 'X'.
ENDIF.
PERFORM BDC_INSERT_fk02.
W_ERR_REC = W_ERR_REC + 1.
PERFORM ERROR_RECORD_DATA1.
ENDIF.
endform. " CALL_TRANSACTION_FK02
*& Form OPEN_BDC_SESSION_fk02
Form used to Open session for FK02
form OPEN_BDC_SESSION_fk02 .
DATA : L_USERID TYPE APQ_MAPN, " Variable to hold user-id
L_GROUP TYPE APQ_GRPN. " Variable to hold value
MOVE P_GROUP1 TO L_GROUP.
MOVE SY-UNAME TO L_USERID.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = L_GROUP
KEEP = SPACE
USER = L_USERID
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-008. " Unable to open BDC Session
ENDIF.
endform. " OPEN_BDC_SESSION_fk02
*& Form BDC_INSERT_fk02
Form used to insert data into BDC session using FK02
form BDC_INSERT_fk02 .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'FK02'
TABLES
DYNPROTAB = IT_BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-009. " Unable to Insert Data to BDC Session
ENDIF.
endform. " BDC_INSERT_fk02
*& Form display_changed_report
Form to display Updated Vendor data
form display_changed_report .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O10. " Updated List for Vendor Master
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O11. " Updated List for Vendor Master Extended
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
17 SY-VLINE,
18 TEXT-H02, " Company Code
31 SY-VLINE,
32 TEXT-H04, " Message
100 SY-VLINE.
FORMAT COLOR OFF.
WRITE:/ SY-ULINE(100).
LOOP AT IT_succ_rec1 INTO WA_IT_succ_rec1.
FORMAT COLOR 2.
WRITE:/1 SY-VLINE,
2 WA_IT_succ_rec1-LIFNR,
17 SY-VLINE,
18 WA_IT_succ_rec1-BUKRS,
31 SY-VLINE,
32 WA_IT_succ_rec1-MSG,
100 SY-VLINE.
CLEAR : WA_IT_succ_rec1.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/ SY-ULINE(100).
endform. " display_changed_report
*& Form display_nochange_report
Form to display No Changed data for Vendors
form display_nochange_report .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O12. " No Changes List for Vendor Master
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O13. " No Changes List for Vendor Master Extended
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
17 SY-VLINE,
18 TEXT-H02, " Company Code
31 SY-VLINE,
32 TEXT-H04, " Message
100 SY-VLINE.
FORMAT COLOR OFF.
WRITE:/ SY-ULINE(100).
LOOP AT IT_noupdate INTO WA_IT_noupdate.
FORMAT COLOR 2.
WRITE:/1 SY-VLINE,
2 WA_IT_noupdate-LIFNR,
17 SY-VLINE,
18 WA_IT_noupdate-BUKRS,
31 SY-VLINE,
32 WA_IT_noupdate-MSG,
100 SY-VLINE.
CLEAR : WA_IT_noupdate.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/ SY-ULINE(100).
endform. " display_nochange_report
*& Form ERROR_RECORD_DATA1
Form to get Error Message for Changed Vendors
form ERROR_RECORD_DATA1 .
DATA : L_LINES TYPE I,
L_MSG(200) TYPE C.
DESCRIBE TABLE IT_MESSTAB LINES L_LINES.
READ TABLE IT_MESSTAB INTO WA_IT_MESSTAB INDEX L_LINES.
IF SY-SUBRC = 0.
CLEAR L_MSG.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_IT_MESSTAB-MSGID
LANG = SY-LANGU
NO = WA_IT_MESSTAB-MSGNR
V1 = WA_IT_MESSTAB-MSGV1
V2 = WA_IT_MESSTAB-MSGV2
V3 = WA_IT_MESSTAB-MSGV3
V4 = WA_IT_MESSTAB-MSGV4
IMPORTING
MSG = L_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WA_IT_ERROR_fk02-MSG = L_MSG.
ENDIF.
IF P_VENMAS = 'X'.
WA_IT_ERROR_fk02-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_ERROR_fk02-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
ELSEIF P_VENEXT = 'X'.
WA_IT_ERROR_fk02-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
WA_IT_ERROR_fk02-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
ENDIF.
APPEND WA_IT_ERROR_fk02 TO IT_ERROR_fk02.
CLEAR WA_IT_ERROR_fk02.
ENDIF.
endform. " ERROR_RECORD_DATA1
*& Form display_error_report_fk01
Form to display Error Report for Master Vendors (FK01)
form display_error_report_fk01 .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O05. " Error List for Vendor Master (FK01)
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O06. " Error List for Vendor Master Extended (FK01)
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
17 SY-VLINE,
18 TEXT-H02, " Company Code
31 SY-VLINE,
32 TEXT-H04, " Message
100 SY-VLINE.
FORMAT COLOR OFF.
WRITE:/ SY-ULINE(100).
LOOP AT IT_ERROR_fk01 INTO WA_IT_ERROR_fk01.
FORMAT COLOR 2.
WRITE:/1 SY-VLINE,
2 WA_IT_ERROR_fk01-LIFNR,
17 SY-VLINE,
18 WA_IT_ERROR_fk01-BUKRS,
31 SY-VLINE,
32 WA_IT_ERROR_fk01-MSG,
100 SY-VLINE.
CLEAR : WA_IT_ERROR_fk01.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/ SY-ULINE(100).
endform. " display_error_report_fk01
*& Form display_error_report_fk02
Form to display Error Report for changed Vendors (FK02)
form display_error_report_fk02 .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O14. " Error List for Vendor Master (FK02)
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O15. " Error List for Vendor Master Extended (FK02)
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number -
Goods receipt for purchase order with account assignment 'K'
Hello All,
There are couple of purchase orders with acc.*** "K". On doing the GR for these PO's they have been done with mvt type 103 & mvt typ 105.
I understand that material has been directly consumed to the respective cost center.
How do track the internal movement for these materials??
I need to view the stock for these materials at the cost center as in MMBE the stock is seen as ZERO.
All these materials are with QM proc ACTIVE. So a goods receipt is done 105, then the inspection lot is cleared. However, in this case as the material is directly consumed, it is NOT displayed in QA32.
Is the above procedure correct??? Is it better to receive stock against mvt type 101 & then do a 201 mvt ??
Request your inputs.....
Regards,
Manoj ReddyAccount assignment inventories are not maintained. To maintain a report for cost center receiving/issuing you need to make a customized report with help of ABAP.
Other way is to pull report in MB51, with selection criteria COST CENTER and it will give you result of stocks available on cost center. For stocks received on cost center, you can pull report with cost center and movement 101.
201 is used for goods issue to cost center from warehouse, the stock you receive from PO against 101 is directly charged to cost center, so no need to issue later to cost center.
Edited by: Afshad Irani on May 17, 2010 2:17 PM -
Purchase Order History not appearing for Purchase Order with service items
A purchase order with a service item has been created. A SES has been created and Miro transactions as well. When tcode ME2L is executed, the Purchase Order History field is blank. Any configuration missing or is there an applicable OSS note to fix this?
Hi,
It is a coding error.
Could you please check if you have applied the note 1049031 with the latest version 13?
Regards,
Edit -
Individual purchase order with subcontracting material
Hi all,
I've implemented a individual purchase order in a sale order by means of 'TAB' category item. The material has been set as 'subcontracting'.
When I create the sale order, a purchase requisition is automatically created with M imputation and special stock 'E'.
Once I create, the purchase order with reference to purchase requisition, I set 'L' category item. Then I save the purchase order.
In order to simplify the flowchart, the vendor has enough stock to manufacture the required material.
Then, Tx. MIGO, stock input with reference to purchase order.
For the FERT material --> movement 101 E + is set.
For the component --> movement 121 E - is set.
How can I obtain 121 'O' - movement for components in order to decrease SC vendor stock?
Thank you very much in advance for your support.
Best regards,
Alberto Ramos.Dear Charlie,
Thank you very much for your response. As you comment, I made a mistake with the number of movement. Certainly the movement for raw material consumption is 543.
I have executed the flowchart you describe. In your case, an independent subcontracting purchase order is done. This flowchart works correctly (with the results you comment. Actually the raw consumption are related to mov. 543 O -).
The problem is when purchse order is related to a sales order. That is:
1. Sale order TA with only one position material A. Category item 'TAB'.
2. Material master for material A --> MRP 2 view --> Special procurement field: 30 - Subcontracting
3. An automatic purchase requisition is created (thanks to 'TAB' category item, schedule line, ...)
4. Tx. ME21N --> I create a purchase order with reference purchase requisition:
4.1. Account assignment category field is set to 'M' from sales order / purchse requisition
4.2. I manually set Item category field to 'L' for indicating subcontracting (I don't force this to be 'L' from sales order / purchase requisition because I need to use the same flowchart for subcontracting and not subcontracting materials)
5. Tx. MIGO
5.1. For Fert material the system executes mov. 101 E + (as in your description)
5.2. For raw materials the system exectures mov. 543 E - ( instead of 543 O -). I would like to obtain the reduction of subcontracting stock, because this material is in my center but povided to SC manufacturer.
Should I do a 'Subsequent adjustment' by means of Tx. MIGO the movement are:
- FERT material 121 E - (depending on adjustment)
- Raw materials 543 E - (again 'E' instead of 'O' which is the result I would like to obtain).
I will very much appreciate your comments.
Thank you again, -
SAP Business Connector with Java (material master data)
Hey,
I have a question about the SAP BC. What are the steps I have to do, to use the BC with a Java program?
My task is to create a program which downloads material master datas from SAP.
I just installed the BC, and hope, that I did it correctly
Many thanks in advance!!
Kind regards,
Alex
German Version:
Hey,
wie ich oben schon geschrieben habe, habe ich ein paar Fragen zum SAP BC. Ich habe ein Hochschul-Projekt und muss hierfür Materialstammdaten aus SAP herunterladen und mit einem Java Programm ausgeben lassen.
Kann mir vielleicht jemand weiterhelfen, wie die Schritte hierfür aussehen?! Wie verbinde ich den BC mit meinem SAP System? und wie bekomme ich anschließen die Daten mit einem Java Programm ausgelesen?
Ich habe bereits den BC installiert und konnte mich meines Wissens auch richtig anmelden;-)
Ich hoffe, dass mir jemand weiterhelfen kann und bedanke mich schon im Voraus für eventuelle Antworten!!!
Viele Grüße
Alex
Edited by: Rolf Gersbacher on May 19, 2010 10:34 PMHi,
I work with SAP BC some time ago... I remember that you configure the connection in SM59 / SICF and the server open a port to "listen" (connect external).
So, your external program can execute functions inside SAP and exchange data.
See some links:
http://en.wikipedia.org/wiki/SAP_Business_Connector
http://help.sap.com/saphelp_nw04/helpdata/en/6a/3f93404f673028e10000000a1550b0/frameset.htm
http://www.thespot4sap.com/articles/SAP_XML_Business_Integration.asp
Best regards,
Leandro Mengue -
Set default value for price unit when creating material master data
HI: Every
could you tell me how to use user-exit or else ways to set default value(such as 1000) for field "Price unit" (MBEW-PEINH) when creating material master data(MM01)?
I have try to use Exit:EXIT_SAPLMGMU_001. However, this way cannot respones it.
thanks
HenryHi: Ihave find out a solution
Use BADI: BADI_MATERIAL_REF
SPROlogistics general enhancement supplement or change default data (industry)
And then creating a Implementation Name
Double click method: CREATE_MATERIAL
And then write code as below:
method IF_EX_MATERIAL_REFERENCE~CREATE_MATERIAL.
c_mbew-peinh = '1000' .
endmethod.
However, SAP still store '1000' in database evenif we change the default value such as 100 when we use TCode MM01.
in additional, we still use MM02 to change the default value such as '100'
can anybody tell me how to do?
thanks
Henry -
LIV for Purchase Orders with Account Assignment
Hi SAP Gurus,
I would like to get your expert advice on this...
I enabled total based invoice acceptance and reduction by performing the required configuration steps (define vendor tolerance group, set up the auto invoice reduction tolerance checks, assigned the tolerance group to the vendor). I was assuming that this would work for my purchase order which contains an account assignment. However, when I tested it out, instead of behaving as expected (create invoice and credit memo for the excess value), the system generated only 1 accounting document. The price variance was posted back to the account assignment assigned to the PO item.
Did I miss out on any steps? or is this the way SAP treats account assigned (non-stock) PO items (i.e. no invoice reduction occurs). If so, can you explain to me why?
Best regards,
RiVeR
Edited by: delo celo on Jul 14, 2010 6:16 PMHi Delo,
Please find answers to your queries below in bold.
1. I was just wondering why would SAP allow such transaction/s to happen? Wouldn't it compromise the integrity of the whole document trail (PO account assignment is different from the LIV)? -
There could be some business scenarios in some organisations, where in Procurement team uses generic cost centre (header), which is specific to particular department or group, to procure. But at the time of Invoice Receipt, AP team knows exact cost centre or order, etc to post the amounts. To cover these kind of scenarios, SAP probably has provided the option to change acount assignment.
2. Is there a way to edit the Account Assignment for a Purchase Order line item even if that item has been fully received and invoiced? -
These field changes at various levels can be configured via t-code OME9.
a) IR Changeable - This field if selected will allow to change the account assignment of a purchase order item at the time of invoice receipt.
b) Acct. assg. changeable - This field is selected will allow to change account assignment for an item following goods receipt or invoice receipt.
Hope this clarifies your queries.
-Ravi -
GR for purchase order with Account assignment E
Hello All
I am having a scenario where in the BOM structure is as under: A->B->C--->D, D is the raw material, C is the component produced in-house, B is the material which we procure through subcontracting, in the material master of C SPK:30 is used for subcontracting, & A is in-house produced material with purely MTO scenario (20 - strategy).
Once the sales order of A is there we run MRP for it, as per the master data settings described above we get purchase requisition for D & when I convert it to purchase order it is having account assignment as E.
This is all well but the moment I try to save it, system throws an error stating: 'G/L account 20500100 cannot be used (please correct)". This G/L account is of raw material itself.
Can you please guide me to overcome this problem.
I am looking forward to listen from you soon.
Regards,
J K TharwaniHi
Check the OBYC settings for this transaction, assign the correct G/L for this transaction. Try to get the help from MM consultant to resolve this.
Check in BSX Transaction for the invetroy posting.
Check the G/L account it is exist for your company code.
Take the G/L account which is coming in the error message and go to FS00 t code select tab Create/blank/interest , there you will have field status group just double click on that . It will take you to field status group display in that check the combination of the selection.
Thanks
S.Murali
Edited by: S. Murali on Jun 26, 2009 5:07 PM
Edited by: S. Murali on Jun 26, 2009 5:19 PM -
BAPI for PURCHASE ORDER with OPEN QUANTITY field
Hi All,
I wanted to use the BAPI_PO_GETDETAIL to get the Purchase Order details upon triggering from Warehouse management system,
But the details required contains a field called OPEN QUANTITY...which is not used in this BAPI.
I request to let me know if any BAPI exits for PO details having the structure for this field:Open Quantity.
Am using SAP version 4.0B.
If not exists please advise how to customize the existing BAPI to meet the requirement.
thanks
mahiHi,
Open quantity is a calculated field. I guess the BAPI gives the details of the delivery, so take the ordered qty and substract the delivered qty from that.
Delivery data is EKET table.
Regards,
Ravi
Maybe you are looking for
-
Exclude a server from background processing of a job
I have a background job that runs slowly on only the Central Instance on the database server host. The 6 other application servers run the same job in half the time. How can I configure this job to run on all but one application server? Is there s
-
Why can't I get my iPod touch to connect with my wifi?
I am unable to get my iPod touch to connect to my wifi even though I've verified the password is correct. Can anyone help?
-
FCP keeps crashing when loading thumbnails from bin
Hey folks, I am having constant issues where FCP keeps crashing when I load a bin with thumbnails. This doesn't happen every time I open a bin, but after I open say 6 or 7 bins. After the research I have done I have come to a couple of possible solut
-
Unable to update my app. I can't tap in my Apple ID doesn't let me only password
I am trying to update my app after I updated latest update of X Yosemite and now I am not able to update anything as when I want to tap in Apple ID it doesn't let me only password I can see the example apple ID but I can't write over it or not event
-
Error 2908 when updating iTunes to 11.3.54
Okay so I'm running Windows 7 on my laptop. The other day I got an iPhone and I want to put my music onto it. So I connect it to iTunes, but iTunes won't let me sync up to it without the update. So I figure okay let's update this and get it over with