Direct input from a key board.
Can you get java to read directly from the keyboard, like in C?
Yes you can.
The code below will read an 8 character name from the keyboard and output them to System.out...
byte[] buffer = new byte[8];
int i = 0;
System.out.print("Please type your name : ");
try {
System.in.read(buffer);
} catch (IOException ioe) {
ioe.printStackTrace();
System.out.println("Hello, " + new String(buffer));
Similar Messages
-
Collect all the inputs from a key board
Hai Good afternoon,
I want to collect all inputs from the keyboard of my system.ie not for a particular application. Whatever be the application i want to collect the inputs from the keyboard. I tried with bufferedReader and inputstreamreader but it willl collect the keystrokes when i am typing in the console.
What i have to do for that?
Can anyone help me?
Thanks in advance
JimeshNo ma i didnt get the hint. Obviously.
I want to hook my keyboard if i start the system till
i am switching it off.So your BIOS has a JVM to run a Java program right at start-up? Interesting. -
Entry from the key board is about 6 seconds per letter.
Settings > General > Reset > Reset All Settings
You will not lose any data. This will just clear the settings in your settings app -
Direct input from musical instrument - will cause sound card damage?
I've recently upgraded from a 1gHz eMac to a 2.26gHz late-2009 Mac mini. Part of the reason for the upgrade was that I was having problems with audio input on the eMac, to cut a long story short, but obviously the eMac was getting unbearably slow and it was about time to upgrade.
My question is this: will recording into GarageBand with a direct line-in from my synthesiser keyboard damage the computer or its sound card?
If it helps, I'm using an external display and speaker set (obviously, being a Mac mini) whereas the eMac had an integrated display and speakers.ShedEntertainment wrote:
....will recording into GarageBand with a direct line-in from my synthesiser keyboard damage the computer or its sound card?
It shouldn't. Electronic instruments output a voltage that is close to the "line level" that typical household audio components use.
The worse thing that should happen is that you would get distortion, if the output of the synthesizer is too much for the mac's input. If that happens, either reduce the output of the synthesizer, or put a mixer between the synth and Mac, to give you control over the level reaching the Mac. -
How do I get a pound sign on my key board?
Hello I bought a mac book pro retina 2012 release date 12months old 2nd hand on ebay
I cannot get a pound sign from the key board
All the help on message boards says Alt/Option plus 3 should work. Not for me it doesn't.
I can't change it in system preferences.
Please help
thank you
Paul MaguireGo to System Preferences>Languages & Regions>Keyboard (if you're running Mavericks anyway) and see which keyboard layout you're using:
I'm set for US - and that's where option + 3 produces the £ symbol.
Clinton -
Step and direction pulse from 6024e
Hi,
I am trying to control a stepper motor through labview. I have a PCI-6024e DAQ and a stepper driver (G210A from geckodrive). The stepper driver takes step and direction inputs from a pulse source. Is the 6024e capable of doing this? Are there any vi examples?
Thanks
MikeYes, the 6024E is capable of doing that. If the motor doesn't have to run fast, you can simply use two DIO lines.
If the motor has to run faster than your software loop time allows, then you can program a counter output to send pulses corresponding to the number of degrees you want the motor to rotate.
I don't have example code that specifically operates a stepper, but LabVIEW ships with examples showing counter configurations that will work. -
Restating my issue / question...
When I send email from this iMac, there is a string of characters assigned. The characters are all the "alpha numeric" characters on the QWERTY key board. This only occurs when email is sent from this iMac. The issue does not manifest when using any other lap top or computer.
Hence, I have ruled out the issue is a yahoo mail matter.
Again, I can access the Yahoo mail account form multiple devices and send email without unintended assignment of character strings, but when I send wmail using this iMac, the issue happens everytime.
Characters are stacked verticaly in a column. It looks as if all characters (except function keys) are included in the string.
Any ideas?
GMcPlease read this whole message before doing anything.
This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac.
These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing.
Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects.
Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it. The headings “Step 1” and so on are not part of the commands.
Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply.
Launch the Terminal application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign.
Step 1
Triple-click the line of text below to select it:
kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' | open -f -a TextEdit
Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). A TextEdit window will open with the output of the command. Post the contents of that window, if any — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
Step 2
Repeat with this line:
{ sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; sudo defaults read com.apple.loginwindow LoginHook; } | open -f -a TextEdit
This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step.
Step 3
launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)/{print $3}' | open -f -a TextEdit
Step 4
ls -1A /e*/mach* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts 2> /dev/null | open -f -a TextEdit
Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting.
Step 5
osascript -e 'tell application "System Events" to get name of every login item' | open -f -a TextEdit
Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output.
You can then quit Terminal. -
How can I drop the key board from my calendar. The normal lower right key stopped working
How can I drop the key board from my calendar? The normal lower right key stopped working.
You can install this extension to make it easier to edit userChrome.css:
* ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html
The file needs to have this code:
<pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
#personal-bookmarks #bookmarks-menu-button { display:none !important; }</nowiki></pre>
You can reach the profile folder this way:
*Help > Troubleshooting Information > Profile Directory: Open Containing Folder
The file userChrome.css needs to be in the chrome folder in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so if the chrome folder is missing then you need to create a folder with the name chrome. -
my daughter put a thick layer of vaseline on my key board. I wiped it off but have found that residue is coming up from the cracks between the keys when I type. Any cleaning suggestions?
At least vaseline is non-conductive. It might be easier to replace the keyboard.
-
hi,
in ALV GRID Delete button is working fine but if u select any record and press DELETE in KEYBOARD, that record is deleting but how to disable that delete key in KEY BOARD.
how to solve this problemUse "CL_GUI_ALV_GRID=>MC_STYLE_NO_DELETE_ROW" to disable DEL key from Keyboard in ALV Grid.
-
My Macbook air 2011- key board (a-l) do not respond, but when you hook up an external key board to the usb these keys on the computer also starts functioning as normal and when you disconnect the external key, these keys stops functioning...?
Perform SMC reset
Shut down the computer.
Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
Release all the keys and the power button at the same time.
Press the power button to turn on the computer.
Note: The LED on the MagSafe power adapter may change states or temporarily turn off when you reset the SMC. -
Problem with direct input program while uploading data into database
TABLES: BGR00, " Mappensatz
BMM00, " MM01/MM02 BTCI-Kopfdaten
BMMH1, " MM01/MM02 Hauptdaten
BMMH2, " Länderdaten (Steuern)
BMMH3, " Prognosewerte
BMMH4, " Verbrauchswerte
BMMH5, " Kurztexte
BMMH6, " Mengeneinheiten
BMMH7, " Langtexte
BMMH8. " Referentielle EAN's
Satztypen
DATA: MAPPENSATZ LIKE BMM00-STYPE VALUE '0',
KOPFSATZ LIKE BMM00-STYPE VALUE '1',
HAUPTSATZ LIKE BMM00-STYPE VALUE '2',
KUN_SATZ LIKE BMM00-STYPE VALUE 'Z',
LANDSATZ LIKE BMM00-STYPE VALUE '3',
PROGSATZ LIKE BMM00-STYPE VALUE '4',
VERBSATZ LIKE BMM00-STYPE VALUE '5',
KTEXTSATZ LIKE BMM00-STYPE VALUE '6',
MESATZ LIKE BMM00-STYPE VALUE '7',
TEXTSATZ LIKE BMM00-STYPE VALUE '8',
EANSATZ LIKE BMM00-STYPE VALUE '9'.
Common Data Bereich fuer die extern aufgerufenen Routinen
Initialstrukturen
DATA: BEGIN OF COMMON PART RMMMBIMY.
DATA: BEGIN OF I_BMM00.
INCLUDE STRUCTURE BMM00. " Kopfdaten
DATA: END OF I_BMM00.
DATA: BEGIN OF I_BMMH1.
INCLUDE STRUCTURE BMMH1. " Haupdaten
DATA: END OF I_BMMH1.
DATA: BEGIN OF I_BMMH2.
INCLUDE STRUCTURE BMMH2. " Länderdaten
DATA: END OF I_BMMH2.
DATA: BEGIN OF I_BMMH3.
INCLUDE STRUCTURE BMMH3. " Prognosewerte
DATA: END OF I_BMMH3.
DATA: BEGIN OF I_BMMH4.
INCLUDE STRUCTURE BMMH4. " Verbrauchswerte
DATA: END OF I_BMMH4.
DATA: BEGIN OF I_BMMH5.
INCLUDE STRUCTURE BMMH5. " Kurztexte
DATA: END OF I_BMMH5.
DATA: BEGIN OF I_BMMH6.
INCLUDE STRUCTURE BMMH6. " Mengeneinheiten
DATA: END OF I_BMMH6.
DATA: BEGIN OF I_BMMH7.
INCLUDE STRUCTURE BMMH7. " Textzeilen
DATA: END OF I_BMMH7.
DATA: BEGIN OF I_BMMH8.
INCLUDE STRUCTURE BMMH8. " Referentielle EAN's
DATA: END OF I_BMMH8.
DATA: END OF COMMON PART.
DATA: WA LIKE TEDATA-DATA.
Einzelfelder
DATA: GROUP_COUNT(6) TYPE C, " Anzahl Mappen
TRANS_COUNT(6) TYPE C, " alte Definition für rmmmbim0
SATZ_COUNT LIKE MUEB_REST-TRANC, " Trans.zähler neu
H_IND_COUNT LIKE MUEB_REST-D_IND, " Index welches Feld zurücks.
SATZ2_COUNT(6) TYPE C. " Anz. Sätze je Trans. ohne Kopfsatz
DATA: XEOF(1) TYPE C, " X=End of File erreicht
XHAUPTSATZ_EXIST TYPE C, " X=Hauptsatz zum Kopf exi.
NODATA(1) TYPE C. " kein BI für dieses Feld
mk/15.08.94:
DATA: GROUP_OPEN(1) TYPE C. " X=Mappe schon geöffnet
*eject
Konstanten
DATA: C_NODATA(1) TYPE C VALUE '/'. " Default für NODATA
DATA: MATNR_ERW LIKE MARA-MATNR VALUE '0 '.
DATA: MATNR_ERW_INT LIKE MARA-MATNR. "internal sight of '0 '
DATA: MATNR_LAST LIKE MARA-MATNR. "Material number
mk/11.08.94 2.1H:
If this flag is initial, the database updates will be done directly
during background maintenance instead of using a separate update
task. (no usage of this flag in dialogue mode!)
DATA: DBUPDATE_VB(1) VALUE ' '. "note 306628
data: matsync type mat_sync. "wk/99a no update in dialog if called
***INCLUDE ZMUSD070.
TABLES: MARA, "Material Master: General Data
MARC, "Material Master: C Segment
MARD, "Material Master: St Loc/Batch
MBEW, "Material Valuation
MVKE, "Material Master: Sales Data
MLGN, "Material Data per Whse Number
MLAN, "Tax Classification: Material
T001W, "Plants/Branches
TBICU.
DATA: BEGIN OF VALUTAB OCCURS 0.
INCLUDE STRUCTURE RSPARAMS.
DATA: END OF VALUTAB.
DATA: BEGIN OF VARTECH.
INCLUDE STRUCTURE VARID.
DATA: END OF VARTECH.
DATA: PARMS LIKE ZXXDCONV.
DATA: REC_COUNT TYPE I,
REC_COUNT_BAD TYPE I,
ZJOBID LIKE TBIZU-JOBID,
ZJOBCOUNT LIKE TBIZU-JOBCOUNT,
ZMATNR LIKE MARA-MATNR,
ZTEXT(80) TYPE C.
CONSTANTS: LIT_ZERO(18) TYPE C VALUE '000000000000000000',
LIT_CHAR TYPE C VALUE '_',
LIT_CREATE LIKE BMM00-TCODE VALUE 'MM01',
LIT_CHANGE LIKE BMM00-TCODE VALUE 'MM02',
LIT_CHECK(1) TYPE C VALUE 'X'.
DATA: BEGIN OF INP_DATA OCCURS 0,
MATNR(18) TYPE C, " Material code
UMREN(6) TYPE C, " Denominator
MEINH(3) TYPE C, " Alternate UOM
UMREZ(6) TYPE C, " Numerator
END OF INP_DATA.
*eject
SELECTION-SCREEN BEGIN OF BLOCK INOUT WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (13) TEXT-004.
PARAMETERS: P_PC RADIOBUTTON GROUP SRC DEFAULT 'X'.
SELECTION-SCREEN COMMENT (6) TEXT-005.
PARAMETERS: P_UNIX RADIOBUTTON GROUP SRC.
SELECTION-SCREEN COMMENT (6) TEXT-006.
PARAMETERS: P_DS_TYP LIKE ZXXDCONV-DS_TYP
DEFAULT 'ASC'.
SELECTION-SCREEN END OF LINE.
*SELECT-OPTIONS: S_PATH FOR PARMS-PATH
NO INTERVALS
LOWER CASE.
PARAMETERS: P_PATH TYPE RLGRAP-FILENAME.
PARAMETERS: P_HDRLIN LIKE ZXXDCONV-HDR_LINES
DEFAULT 0,
P_JOBNAM LIKE TBICU_S-JOBNAME
MEMORY ID BM1,
P_DI_EXE AS CHECKBOX
DEFAULT LIT_CHECK,
P_MAPPE LIKE BGR00-GROUP
DEFAULT 'MRP_UOM_LOAD'
NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK INOUT.
*eject
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PATH.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_PATH'
CHANGING
FILE_NAME = S_PATH-LOW
FILE_NAME = P_PATH
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
AT SELECTION-SCREEN.
Set up parameter record
PARMS-UNIX = P_UNIX.
PARMS-PC = P_PC.
PARMS-DS_TYP = P_DS_TYP.
PARMS-JOBNAME = P_JOBNAM.
PARMS-MAPPE = P_MAPPE.
PARMS-HDR_LINES = P_HDRLIN.
*eject
Main Processing Routine *
START-OF-SELECTION.
Initialization
PERFORM 0000_HOUSEKEEPING.
Initialize transaction data in I_BM00
PERFORM 0500_INIT_BMM00.
Process input files
SORT S_PATH BY SIGN OPTION LOW.
MOVE S_PATH-LOW TO PARMS-PATH.
MOVE P_PATH TO PARMS-PATH.
LOOP AT S_PATH.
AT NEW LOW.
CLEAR INP_DATA.
REFRESH INP_DATA.
Read source data into internal table
PERFORM 1000_GET_SOURCE_DATA TABLES INP_DATA.
Processs each record in internal table
ZTEXT = TEXT-007.
ZTEXT+13 = PARMS-DS_NAME.
PERFORM 4000_PROGRESS_INDICATOR USING ZTEXT.
Initialize transaction data in I_BM00
PERFORM 0500_INIT_BMM00.
LOOP AT INP_DATA.
Reset tables for each record
BMM00 = I_BMM00.
BMMH1 = I_BMMH1.
BMMH6 = I_BMMH6.
Load structures with data
MOVE-CORRESPONDING INP_DATA TO BMM00.
PERFORM 2000_WRITE_OUTPUT USING BMM00.
MOVE-CORRESPONDING INP_DATA TO BMMH1.
PERFORM 2000_WRITE_OUTPUT USING BMMH1.
MOVE-CORRESPONDING INP_DATA TO BMMH6.
PERFORM 2000_WRITE_OUTPUT USING BMMH6.
REC_COUNT = REC_COUNT + 1.
ENDLOOP.
ENDAT.
ENDLOOP.
IF REC_COUNT GT 0
AND P_DI_EXE EQ LIT_CHECK.
PERFORM 3000_START_DI_JOB.
ENDIF.
WRITE: / TEXT-008,
REC_COUNT.
PERFORM 9000_END_OF_JOB.
*eject
Include containing common routines used by direct input programs
INCLUDE ZMUSD071.
*eject
FORM 0500_INIT_BMM00 *
Initialize I_BMM00 with transaction code and views selected *
FORM 0500_INIT_BMM00.
***this changes done by samson**
if not inp_data[] is initial.
select single matnr from mara INTO ZMATNR where matnr = inp_data-matnr.
if sy-subrc = 0.
I_BMM00-TCODE = LIT_CHANGE.
Basic data
I_BMM00-XEIK1 = LIT_CHECK.
else.
I_BMM00-TCODE = LIT_CREATE.
Basic data
I_BMM00-XEIK1 = LIT_CHECK.
endif.
endif.
**this changes above done by samson**
Transaction code
I_BMM00-TCODE = LIT_CHANGE.
Basic data
I_BMM00-XEIK1 = LIT_CHECK.
ENDFORM.
INCLUDE ZMUSD069.
*eject
FORM 0000_HOUSEKEEPING *
Initialization routines *
FORM 0000_HOUSEKEEPING.
PERFORM 0010_LDS_NAME.
PERFORM 0020_DS_NAME.
PERFORM 0030_OPEN_FILE.
PERFORM 0040_INIT_STRUCTS.
ENDFORM.
*eject
FORM 0010_LDS_NAME *
Obtain logical file name from DI job details *
FORM 0010_LDS_NAME.
Check valid job name
SELECT SINGLE * FROM TBICU
WHERE JOBNAME EQ PARMS-JOBNAME.
IF SY-SUBRC EQ 0.
CALL FUNCTION 'RS_VARIANT_VALUES_TECH_DATA'
EXPORTING
REPORT = TBICU-REPNAME
VARIANT = TBICU-VARIANT
IMPORTING
TECHN_DATA = VARTECH
TABLES
VARIANT_VALUES = VALUTAB
EXCEPTIONS
VARIANT_NON_EXISTENT = 1
VARIANT_OBSOLETE = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
READ TABLE VALUTAB WITH KEY 'LDS_NAME'.
MOVE VALUTAB-LOW TO PARMS-LDS_NAME.
ELSE.
MESSAGE I001 WITH PARMS-JOBNAME.
MESSAGE A099.
ENDIF.
ELSE.
MESSAGE I000 WITH PARMS-JOBNAME.
MESSAGE A099.
ENDIF.
ENDFORM.
*eject
FORM 0040_INIT_STRUCTS *
Initialize structures for direct input records *
FORM 0040_INIT_STRUCTS.
Start of standard SAP initialization from example program RMMMBIME
*------- Write session record -
CLEAR BGR00.
BGR00-STYPE = MAPPENSATZ.
BGR00-GROUP = PARMS-MAPPE.
BGR00-NODATA = C_NODATA.
BGR00-MANDT = SY-MANDT.
BGR00-USNAM = SY-UNAME.
BGR00-START = BGR00-NODATA.
BGR00-XKEEP = BGR00-NODATA.
PERFORM 2000_WRITE_OUTPUT USING BGR00.
*----- Initialize structures -
NODATA = BGR00-NODATA.
PERFORM INIT_STRUKTUREN_ERZEUGEN(RMMMBIMI) USING NODATA.
End of standard SAP initialization from example program RMMMBIME
ENDFORM.
*eject.
FORM 3000_START_DI_JOB *
Start direct input job *
FORM 3000_START_DI_JOB.
ZTEXT = 'Starting '(021).
ZTEXT+9 = TBICU-JOBNAME.
PERFORM 4000_PROGRESS_INDICATOR USING ZTEXT.
CALL FUNCTION 'BI_START_JOB'
EXPORTING
JOBID = ' '
JOBTEXT = TBICU-JOBNAME
REPNAME = TBICU-REPNAME
SERVER = TBICU-EXECSERVER
VARIANT = TBICU-VARIANT
NEW_JOB = 'X'
CONTINUE_JOB = ' '
START_IMMEDIATE = 'X'
DO_NOT_PRINT = 'X'
USERNAME = SY-UNAME
IMPORTING
JOBID = ZJOBID
JOBCOUNT = ZJOBCOUNT
EXCEPTIONS
JOB_OPEN_FAILED = 1
JOB_CLOSE_FAILED = 2
JOB_SUBMIT_FAILED = 3
WRONG_PARAMETERS = 4
JOB_DOES_NOT_EXIST = 5
WRONG_STARTTIME_GIVEN = 6
JOB_NOT_RELEASED = 7
WRONG_VARIANT = 8
NO_AUTHORITY = 9
DIALOG_CANCELLED = 10
JOB_ALREADY_EXISTS = 11
PERIODIC_NOT_ALLOWED = 12
ERROR_NUMBER_GET_NEXT = 13
OTHERS = 14.
IF SY-SUBRC EQ 0.
WRITE: / 'Direct input job'(022), TBICU-JOBNAME, 'started'.
ELSE.
WRITE: / 'Direct input failed with return code'(023), SY-SUBRC.
ENDIF.
FORM 0020_DS_NAME.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
CLIENT = SY-MANDT
LOGICAL_FILENAME = PARMS-LDS_NAME
OPERATING_SYSTEM = SY-OPSYS
IMPORTING
FILE_NAME = PARMS-DS_NAME
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
MESSAGE E002 WITH PARMS-LDS_NAME.
MESSAGE A099.
ENDIF.
ENDFORM.
*eject
FORM 0030_OPEN_FILE *
Open physical file for output *
FORM 0030_OPEN_FILE.
OPEN DATASET PARMS-DS_NAME FOR OUTPUT IN TEXT MODE. "thg191105
OPEN DATASET PARMS-DS_NAME FOR OUTPUT IN TEXT MODE
encoding default. "thg191105
IF SY-SUBRC NE 0.
MESSAGE E003 WITH PARMS-DS_NAME.
MESSAGE A099.
ENDIF.
ENDFORM.
*eject
FORM 1000_GET_SOURCE_DATA *
Read source data into internal table *
--> INP_DATA " Name of internal table passed as parameter *
FORM 1000_GET_SOURCE_DATA TABLES INP_DATA.
CALL FUNCTION 'Z_FILE_UPLOAD'
EXPORTING
UNIX = PARMS-UNIX
PC = PARMS-PC
FILETYPE = PARMS-DS_TYP
FILENAME = PARMS-PATH
HDR_LINES = PARMS-HDR_LINES
TABLES
DATA_TAB = INP_DATA
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
INVALID_SOURCE = 8
OTHERS = 9.
ENDFORM.
*eject
FORM 2000_WRITE_OUTPUT *
Write record in standard SAP structure to UNIX file *
--> I_STRUCT " Name of record passed as parameter *
*FORM 2000_WRITE_OUTPUT USING I_STRUCT."SRY28NOV05
FORM 2000_WRITE_OUTPUT USING I_STRUCT TYPE ANY. "SRY28NOV05
TRANSFER I_STRUCT TO PARMS-DS_NAME.
IF SY-SUBRC NE 0.
MESSAGE E004 WITH PARMS-DS_NAME.
MESSAGE A099.
ENDIF.
ENDFORM.
*eject
*& Form 2100_WS_DOWNLOAD
text *
--> p1 text
<-- p2 text
FORM 2100_WS_DOWNLOAD TABLES INP_DATA.
DATA: FILENAME LIKE RLGRAP-FILENAME. "SRY28NOV05
DATA: W_FILENAME TYPE STRING. "SRY28NOV05
DATA: W_FTYP(10) TYPE C VALUE 'DAT'. "SRY28NOV05
MOVE PARMS-DS_NAME TO FILENAME. "SRY28NOV05
MOVE PARMS-DS_NAME TO W_FILENAME. "SRY28NOV05
*BEGIN OF BLOCK COMMENT BY SRY28NOV05
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME = FILENAME
FILETYPE = 'DAT'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
importing
filelength =
TABLES
DATA_TAB = INP_DATA
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
*END OF BLOCK COMMENT BY SRY28NOV05
*BEGIN OF BLOCK ADDED BY SRY28NOV05
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = W_FILENAME
FILETYPE = W_FTYP
TABLES
DATA_TAB = INP_DATA
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*END OF BLOCK ADDED BY SRY28NOV05
ENDFORM. " 2100_WS_DOWNLOAD
*eject
FORM 4000_PROGRESS_INDICATOR *
Write progress text to status bar *
--> TEXT " Text passed as parameter *
FORM 4000_PROGRESS_INDICATOR USING TEXT.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT
EXCEPTIONS
OTHERS = 1.
ENDFORM.
*eject.
FORM 9000_END_OF_JOB *
Close files on UNIX *
FORM 9000_END_OF_JOB.
CLOSE DATASET PARMS-DS_NAME.
ENDFORM.
FORM 1000_GET_SOURCE_DATA TABLES INP_DATA.
CALL FUNCTION 'Z_FILE_UPLOAD'
EXPORTING
UNIX = PARMS-UNIX
PC = PARMS-PC
FILETYPE = PARMS-DS_TYP
FILENAME = PARMS-PATH
HDR_LINES = PARMS-HDR_LINES
TABLES
DATA_TAB = INP_DATA
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
INVALID_SOURCE = 8
OTHERS = 9.
ENDFORM.
*eject
FORM 2000_WRITE_OUTPUT *
Write record in standard SAP structure to UNIX file *
--> I_STRUCT " Name of record passed as parameter *
*FORM 2000_WRITE_OUTPUT USING I_STRUCT."SRY28NOV05
FORM 2000_WRITE_OUTPUT USING I_STRUCT TYPE ANY. "SRY28NOV05
TRANSFER I_STRUCT TO PARMS-DS_NAME.
IF SY-SUBRC NE 0.
MESSAGE E004 WITH PARMS-DS_NAME.
MESSAGE A099.
ENDIF.
ENDFORM.
*eject
*& Form 2100_WS_DOWNLOAD
text *
--> p1 text
<-- p2 text
FORM 2100_WS_DOWNLOAD TABLES INP_DATA.Hi,
Thnaks for your reply, This is my requirement.
Here my problem is i am trying to upload the data from flatfile which contain materil number, denominator, Actual UOM, Nominator field values.
Which is the data i need to upload into MM02 and MM01, if material number is new then it has to create the material, if material is already existing it has to update the UOM values.
here i am getting data into my internal table INP_DATA, from that i am trying to upload the data to database by using job name MRP_MATERIAL_MASTER_DATA_UPLOAD with direct input program RMDATIND.
when i execute my program i am getting success message all the records writtin from flatfile to application server. and job started message.
then if i go into sm37 screen there i execute the job it is also giving active message. if i refresh it it is showing job completed message.
then i look at job log status. there i found that for existing material it is expecting material type, for new material it is giving some gravity error.
So could u help me in this it will be gr8.
Thanks & Regards,
RamNV -
Accounts Receivable Upload - Direct Input LSMW
Hi All,
I am using the Direct Input method for uploading AR data. Here we have 2 posting keys. One does not have profit center and the other has profit center. I have used the approach of header file and item file where the items are linked to the header by the position number (first field in both files). I have mapped the PRCTR from the structure BBSEG to the source field.
When the batch input session is run from SM35 the records go into error. This is because the LSMW is looking for the PRCTR (profit center) field even when the item does not need the profit center and so does not display it.
I want to know what is the approach you have followed to resolve such an issue. Because of the mapping the LSMW is looking for PRCTR even when it is not displayed for some line items (depending on posting key).
Looking forward to prompt replies. Thanks,
kajalHi All,
I found a solution. Need to put in a rule for the field and code it as '/' whenever want to skip it. -
Hi,
Is there any standard direct input programs for material master upload.
rgds
p.kpHi
There is a standard Programs for Different Modules.
But you need to populate the Data, and send the data to the Direct Input Program in a specific format , format in the sense you need to populate the nodata for fields which you don't want to update.
and submit to the std direct input program.
check the code below..
*& Report Z__DIRECT__MAT___CREAT *
REPORT Z__DIRECT__MAT___CREAT .
INCLUDE Z_INCLUDE_MAT_CREAT.
* SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
PARAMETERS:P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1 .
* AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE.
*START-OF-SELECTION
START-OF-SELECTION.
*Perform to upload the data from Presentation Server
V_FILE = P_FILE.
PERFORM UPLOAD_DATA.
*Transfer the Data to the structure BGR00 BMMH1 BMM00
PERFORM CONVERT_0000. " BGR00
PERFORM POPULATE_DATA CHANGING BMM00.
PERFORM POPULATE_DATA CHANGING BMMH1.
**Looping the flat file data and updating the structures BMM00 & BMMH1
LOOP AT MATERIAL_MASTER.
*Writing the Data to the Application Server in a proper Format
OPEN DATASET C_ZTEST FOR APPENDING IN TEXT MODE ENCODING
DEFAULT.
*Transfer the Data to the structure BMM00
PERFORM CONVERT_0002. " BMM00
*Transfer the Data to the structure BMMh1
PERFORM CONVERT_0003. " BMMH1
**Closing the dataset after transfering the data
CLOSE DATASET C_ZTEST.
ENDLOOP. "Endloop of MATERIAL_MASTER
*END-OF-SELECTION
END-OF-SELECTION.
**Calling the Direct Input Program to Create the material
SUBMIT RMDATIND WITH %%%_R_P = C_X
WITH %%%_PHY = C_ZTEST
WITH SPERR = C_N.
include for the above..
*& Include Z_INCLUDE_MAT_CREAT *
**Tables Used To Create the Material
TABLES:
BGR00,
BMM00,
BMMH1.
DATA:C_ZTEST(60) type c,
C_X TYPE C,
C_N TYPE C,
V_file type string.
C_ZTEST = 'Ztest.lsmw.conv'(001).
C_X = 'X'(003).
C_N = 'N'(004).
**FILED SYMBOLS
FIELD-SYMBOLS: <F> .
**Structure to Hold the Flat File
data:
begin of LSMW_MATERIAL_MASTER,
MATNR(018) type C, "Material number
MTART(004) type C, "Material type
MBRSH(001) type C, "Industry sector
WERKS(004) type C, "Plant
MAKTX(040) type C, "Material description
DISMM(002) type C, "Extra Field Added In the Program as it is required
MEINS(003) type C, "Base unit of measure
MATKL(009) type C, "Material group
SPART(002) type C, "Division
LABOR(003) type C, "Lab/office
PRDHA(018) type C, "Product hierarchy
MSTAE(002) type C, "X-plant matl status
MTPOS_MARA(004) type C, "Gen item cat group
BRGEW(017) type C, "Gross weight
GEWEI(003) type C, "Weight unit
NTGEW(017) type C, "Net weight
GROES(032) type C, "Size/Dimensions
MAGRV(004) type C, "Matl grp pack matls
BISMT(018) type C, "Old material number
WRKST(048) type C, "Basic material
PROFL(003) type C, "DG indicator profile
KZUMW(001) type C, "Environmentally rlvt
BSTME(003) type C, "Order unit
VABME(001) type C,
EKGRP(003) type C, "Purchasing group
XCHPF(001) type C, "Batch management
EKWSL(004) type C, "Purchasing key value
WEBAZ(003) type C, "GR processing time
MFRPN(040) type C, "Manufacturer part number
MFRNR(010) type C, "Manufacturer number
VPRSV(001) type C, "Price control indicator
STPRS(015) type C, "Standard price
BWPRH(014) type C, "Commercial price1
end of LSMW_MATERIAL_MASTER.
**InternalTable to HOld the Flat File Data
DATA:
BEGIN OF MATERIAL_MASTER OCCURS 0.
INCLUDE STRUCTURE LSMW_MATERIAL_MASTER.
DATA:
END OF MATERIAL_MASTER.
*& Form upload_data From Presentation Server
FORM UPLOAD_DATA.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = V_FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = MATERIAL_MASTER
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.
DELETE MATERIAL_MASTER INDEX 1.
ENDIF.
ENDFORM. "upload_data
*& Updating the BGR00 Structure
FORM CONVERT_0000. " BGR00
**Opening the Data Set to write the data to Application Server
OPEN DATASET C_ZTEST FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
MOVE: '0' TO BGR00-STYPE,
'ZTEST' TO BGR00-GROUP,
SY-MANDT TO BGR00-MANDT,
SY-UNAME TO BGR00-USNAM,
'X' TO BGR00-XKEEP,
'/' TO BGR00-NODATA.
*Transefering the Data To the Application Server File
TRANSFER BGR00 TO C_ZTEST.
*Closing the Dataset after Transfer
CLOSE DATASET C_ZTEST.
ENDFORM. "convert_0001
*& Updating BMM00 Structure
FORM CONVERT_0002. " BMM00
* --- BMM00-STYPE
BMM00-STYPE = '1'.
* --- BMM00-TCODE
BMM00-TCODE = 'MM01'.
* --- BMM00-MATNR
IF NOT MATERIAL_MASTER-MATNR IS INITIAL.
BMM00-MATNR = MATERIAL_MASTER-MATNR.
ELSE.
BMM00-MATNR = '/'.
ENDIF.
* --- BMM00-MBRSH
IF NOT MATERIAL_MASTER-MBRSH IS INITIAL.
BMM00-MBRSH = MATERIAL_MASTER-MBRSH.
ELSE.
BMM00-MBRSH = '/'.
ENDIF.
* --- BMM00-MTART
IF NOT MATERIAL_MASTER-MTART IS INITIAL.
BMM00-MTART = MATERIAL_MASTER-MTART.
ELSE.
BMM00-MTART = '/'.
ENDIF.
* --- BMM00-WERKS
IF NOT MATERIAL_MASTER-WERKS IS INITIAL.
BMM00-WERKS = MATERIAL_MASTER-WERKS.
ELSE.
BMM00-WERKS = '/'.
ENDIF.
BMM00-XEIB1 = 'X'. " BMM00-xeib1 = '/'.
BMM00-XEIE1 = 'X'. " BMM00-xeie1 = '/'.
BMM00-XEIK1 = 'X'. " BMM00-xeik1 = '/'.
**Transfer the data to the Application Server File
TRANSFER BMM00 TO C_ZTEST.
ENDFORM. "convert_0002
*& UPdating BMMH1 Structure
FORM CONVERT_0003. " BMMH1
* --- BMMH1-STYPE
BMMH1-STYPE = '2'.
* --- BMMH1-MEINS
IF NOT MATERIAL_MASTER-MEINS IS INITIAL.
BMMH1-MEINS = MATERIAL_MASTER-MEINS.
ELSE.
BMMH1-MEINS = '/'.
ENDIF.
* --- BMMH1-MAKTX
IF NOT MATERIAL_MASTER-MAKTX IS INITIAL.
BMMH1-MAKTX = MATERIAL_MASTER-MAKTX.
ELSE.
BMMH1-MAKTX = '/'.
ENDIF.
* --- BMMH1-MATKL
IF NOT MATERIAL_MASTER-MATKL IS INITIAL.
BMMH1-MATKL = MATERIAL_MASTER-MATKL.
ELSE.
BMMH1-MATKL = '/'.
ENDIF.
* --- BMMH1-BISMT
IF NOT MATERIAL_MASTER-BISMT IS INITIAL.
BMMH1-BISMT = MATERIAL_MASTER-BISMT.
ELSE.
BMMH1-BISMT = '/'.
ENDIF.
* --- BMMH1-LABOR
IF NOT MATERIAL_MASTER-LABOR IS INITIAL.
BMMH1-LABOR = MATERIAL_MASTER-LABOR.
ELSE.
BMMH1-LABOR = '/'.
ENDIF.
* --- BMMH1-WRKST
IF NOT MATERIAL_MASTER-WRKST IS INITIAL.
BMMH1-WRKST = MATERIAL_MASTER-WRKST.
ELSE.
BMMH1-WRKST = '/'.
ENDIF.
* --- BMMH1-BRGEW
IF NOT MATERIAL_MASTER-BRGEW IS INITIAL.
BMMH1-BRGEW = MATERIAL_MASTER-BRGEW.
ELSE.
BMMH1-BRGEW = '/'.
ENDIF.
* --- BMMH1-NTGEW
IF NOT MATERIAL_MASTER-NTGEW IS INITIAL.
BMMH1-NTGEW = MATERIAL_MASTER-NTGEW.
ELSE.
BMMH1-NTGEW = '/'.
ENDIF.
* --- BMMH1-GEWEI
IF NOT MATERIAL_MASTER-GEWEI IS INITIAL.
BMMH1-GEWEI = MATERIAL_MASTER-GEWEI.
ELSE.
BMMH1-GEWEI = '/'.
ENDIF.
* --- BMMH1-GROES
IF NOT MATERIAL_MASTER-GROES IS INITIAL.
BMMH1-GROES = MATERIAL_MASTER-GROES.
ELSE.
BMMH1-GROES = '/'.
ENDIF.
* --- BMMH1-SPART
IF NOT MATERIAL_MASTER-SPART IS INITIAL.
BMMH1-SPART = MATERIAL_MASTER-SPART.
ELSE.
BMMH1-SPART = '/'.
ENDIF.
* --- BMMH1-BSTME
IF NOT MATERIAL_MASTER-BSTME IS INITIAL.
BMMH1-BSTME = MATERIAL_MASTER-BSTME.
ELSE.
BMMH1-BSTME = '/'.
ENDIF.
* --- BMMH1-EKWSL
IF NOT MATERIAL_MASTER-EKWSL IS INITIAL.
BMMH1-EKWSL = MATERIAL_MASTER-EKWSL.
ELSE.
BMMH1-EKWSL = '/'.
ENDIF.
* --- BMMH1-EKGRP
IF NOT MATERIAL_MASTER-EKGRP IS INITIAL.
BMMH1-EKGRP = MATERIAL_MASTER-EKGRP.
ELSE.
BMMH1-EKGRP = '/'.
ENDIF.
* --- BMMH1-XCHPF
IF NOT MATERIAL_MASTER-XCHPF IS INITIAL.
BMMH1-XCHPF = MATERIAL_MASTER-XCHPF.
ELSE.
BMMH1-XCHPF = '/'.
ENDIF.
* --- BMMH1-WEBAZ
IF NOT MATERIAL_MASTER-WEBAZ IS INITIAL.
BMMH1-WEBAZ = MATERIAL_MASTER-WEBAZ.
ELSE.
BMMH1-WEBAZ = '/'.
ENDIF.
IF NOT MATERIAL_MASTER-DISMM IS INITIAL.
BMMH1-DISMM = MATERIAL_MASTER-DISMM.
ELSE.
BMMH1-DISMM = '/'.
ENDIF.
* --- BMMH1-VPRSV
IF NOT MATERIAL_MASTER-VPRSV IS INITIAL.
BMMH1-VPRSV = MATERIAL_MASTER-VPRSV.
ELSE.
BMMH1-VPRSV = '/'.
ENDIF.
BMMH1-VERPR = '/'.
* --- BMMH1-STPRS
IF NOT MATERIAL_MASTER-STPRS IS INITIAL.
BMMH1-STPRS = MATERIAL_MASTER-STPRS.
ELSE.
BMMH1-STPRS = '/'.
ENDIF.
* --- BMMH1-BWPRH
IF NOT MATERIAL_MASTER-BWPRH IS INITIAL.
BMMH1-BWPRH = MATERIAL_MASTER-BWPRH.
ELSE.
BMMH1-BWPRH = '/'.
ENDIF.
* --- BMMH1-PRDHA
IF NOT MATERIAL_MASTER-PRDHA IS INITIAL.
BMMH1-PRDHA = MATERIAL_MASTER-PRDHA.
ELSE.
BMMH1-PRDHA = '/'.
ENDIF.
* --- BMMH1-VABME
IF NOT MATERIAL_MASTER-VABME IS INITIAL.
BMMH1-VABME = MATERIAL_MASTER-VABME.
ELSE.
BMMH1-VABME = '/'.
ENDIF.
* --- BMMH1-MAGRV
IF NOT MATERIAL_MASTER-MAGRV IS INITIAL.
BMMH1-MAGRV = MATERIAL_MASTER-MAGRV.
ELSE.
BMMH1-MAGRV = '/'.
ENDIF.
* --- BMMH1-KZUMW
IF NOT MATERIAL_MASTER-KZUMW IS INITIAL.
BMMH1-KZUMW = MATERIAL_MASTER-KZUMW.
ELSE.
BMMH1-KZUMW = '/'.
ENDIF.
* --- BMMH1-MFRNR
IF NOT MATERIAL_MASTER-MFRNR IS INITIAL.
BMMH1-MFRNR = MATERIAL_MASTER-MFRNR.
ELSE.
BMMH1-MFRNR = '/'.
ENDIF.
* --- BMMH1-MFRPN
IF NOT MATERIAL_MASTER-MFRPN IS INITIAL.
BMMH1-MFRPN = MATERIAL_MASTER-MFRPN.
ELSE.
BMMH1-MFRPN = '/'.
ENDIF.
BMMH1-MPROF = '/'.
* --- BMMH1-MSTAE
IF NOT MATERIAL_MASTER-MSTAE IS INITIAL.
BMMH1-MSTAE = MATERIAL_MASTER-MSTAE.
ELSE.
BMMH1-MSTAE = '/'.
ENDIF.
* --- BMMH1-PROFL
IF NOT MATERIAL_MASTER-PROFL IS INITIAL.
BMMH1-PROFL = MATERIAL_MASTER-PROFL.
ELSE.
BMMH1-PROFL = '/'.
ENDIF.
* --- BMMH1-MTPOS_MARA
IF NOT MATERIAL_MASTER-MTPOS_MARA IS INITIAL.
BMMH1-MTPOS_MARA = MATERIAL_MASTER-MTPOS_MARA.
ELSE.
BMMH1-MTPOS_MARA = '/'.
ENDIF.
**Transfer the Data to Application Server File
TRANSFER BMMH1 TO C_ZTEST.
ENDFORM. "convert_0003
*& Form POPULATE_DATA
* text
* <--P_BLF text
FORM POPULATE_DATA CHANGING P_BLF.
DATA: L_NUM TYPE I.
DO.
L_NUM = L_NUM + 1.
ASSIGN COMPONENT L_NUM OF STRUCTURE P_BLF TO <F>.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
MOVE BGR00-NODATA TO <F>.
ENDDO.
ENDFORM. " POPULATE_DATA -
LSMW for equipment creation-Standard Batch/Direct Input
Hi,
We developed an LSMW with standard batch / direct input method for creating equipment masters.
We used Object =0400 ( equipment ) and method = 0001 ( batch input)
We maintained source structures and source fileds. In the source field , we maintained only those fields that we need from table IBIPEQUI but in the order given in this structure.
Also we maintained filed mapping and field convertion rules for the above source fields.
When we run LSMW step - Display converted data , we see that
Transactions Read: 1
Records Read: 1
Transactions Written: 0
Records Written: 0
Not sure what could have gone wrong?
Please provide some clues to the following questions.
1) Should the source structure be same as fields from stuc. IBIPEQUI and should it include all the fields in the source structure?
2) Is field mapping required or not ?
3) We are getting an error - transaction is not supported in direct input mode.
Thanks in advance
Rgds,
Rajesh1. Source fields are( same as IBIPEQUI structure ; the tab delimited file matches with these fields)
TCODE C(020) Transaction Code
RECORDNAME C(008) Record name
EQUNR C(018) Equipment
DATSL C(008) Valid On
EQTYP C(001) Equipment category
EQKTX C(040) EQKTX
BEGRU C(004) Authorization Group
EQART C(010) Technical obj. type
GROES C(018) Size/dimensions
INVNR C(025) Inventory number
BRGEW C(017) Gross Weight
GEWEI C(003) Weight unit
ELIEF C(010) Vendor
ANSDT C(008)
ANSWT C(017) Acquisition Value
WAERS C(005) Currency
HERST C(030) Manufacturer
HERLD C(003) Country of manufact.
BAUJJ C(004) Construction year
BAUMM C(002) Construction month
TYPBZ C(020) Model number
SERGE C(030) ManufSerialNumber
MAPAR C(030) ManufactPartNo.
GERNR C(018) Serial number
GWLEN C(008) Warranty end date
KUND1 C(010) Customer
KUND2 C(010) End customer
KUND3 C(010) Operator
SWERK C(004) Maintenance plant
STORT C(010) Location
MSGRP C(008) MSGRP
BEBER C(003) Plant section
ARBPL C(008) Work center
ABCKZ C(001) ABC indicator
EQFNR C(030) Sort field
BUKRS C(004) Company Code
ANLNR C(012) Asset Number
ANLUN C(004) ANLUN
GSBER C(004) Business Area
KOSTL C(010) Cost Center
PROID C(024) PROID
DAUFN C(012) Standing order
AUFNR C(012) Order
TIDNR C(025) Technical IdentNo.
SUBMT C(018) Construction type
HEQUI C(018) Superord. Equipment
HEQNR C(004) Position
EINZL C(001) Single installation
IWERK C(004) Planning plant
INGRP C(003) Planner group
GEWRK C(008) Main work center
WERGW C(004) Plant for WorkCenter
RBNR C(009) Catalog profile
TPLNR C(030) Functional Location
DISMANTLE C(001) DismIndic.
VKORG C(004) Sales Organization
VTWEG C(002) Distribution Channel
SPART C(002) Division
MATNR C(018) Material
SERNR C(018) BOM explosion number
WERK C(004) WERK
LAGER C(004) LAGER
CHARGE C(010) CHARGE
KUNDE C(010)
KZKBL C(001) Load records
PLANV C(003) PLANV
FGRU1 C(004) FGRU1
FGRU2 C(004) FGRU2
STEUF C(004) Control key
STEUF_REF C(001) STEUF_REF
KTSCH C(007) Standard text key
KTSCH_REF C(001) Std text referenced
EWFORM C(006) EWFORM
EWFORM_REF C(001) EWFORM_REF
BZOFFB C(002) Ref. date for start
BZOFFB_REF C(001) BZOFFB_REF
OFFSTB C(007) Offset to start
EHOFFB C(003) Unit
OFFSTB_REF C(001) OFFSTB_REF
BZOFFE C(002) Ref. date for finish
BZOFFE_REF C(001) BZOFFE_REF
OFFSTE C(007) Offset to finish
EHOFFE C(003) Unit
OFFSTE_REF C(001) OFFSTE_REF
WARPL C(012) Maintenance Plan
IMRC_POINT C(012) Measuring point
INDAT C(008) Inverse date
INTIM C(006) Processing time OC Workbe
INBDT C(008) Start-up date
GWLDT C(008) Guarantee
AULDT C(008) Delivery date
LIZNR C(020) License number
MGANR C(020) Master warranty
REFMA C(018) REFMA
VKBUR C(004) Sales Office
VKGRP C(003) Sales Group
WARR_INBD C(001) Inbound warranty
WAGET C(001) Warranty inheritance poss
GAERB C(001) Indicator: Pass on warran
ACT_CHANGE_AA C(001) ACT_CHANGE_AA
STRNO C(040) STRNO
DATLWB C(008) Date Last Goods Movmnt
UII C(072) UII
IUID_TYPE C(010) IUID Type
UII_PLANT C(004) Plant Responsible for UII
2, source structure is assigned to target structure IBIPEQUI
3. In the assign files step - all settings given above are correctly maintained.
4. Field mapping
TCODE Transaction Code
Rule : Default Settings
Code: IBIPEQUI-TCODE = 'IE01'.
RECORDNAME IBIP: Name of the Data Transfer Record
Rule : Default Settings
Code: IBIPEQUI-RECORDNAME = 'IBIPEQUI'.
EQUNR Equipment Number
Source: ZIE01_002_SOURCE-EQUNR (Equipment)
Rule : Transfer (MOVE)
Code: if not ZIE01_002_SOURCE-EQUNR is initial.
IBIPEQUI-EQUNR = ZIE01_002_SOURCE-EQUNR.
endif.
DATSL Date valid from
Source: ZIE01_002_SOURCE-DATSL (Valid On)
Rule : Transfer (MOVE)
Code: if not ZIE01_002_SOURCE-DATSL is initial.
IBIPEQUI-DATSL = ZIE01_002_SOURCE-DATSL.
endif.
EQTYP Equipment category
Source: ZIE01_002_SOURCE-EQTYP (Equipment category)
Rule : Transfer (MOVE)
Code: if not ZIE01_002_SOURCE-EQTYP is initial.
IBIPEQUI-EQTYP = ZIE01_002_SOURCE-EQTYP.
endif
When I read data with 1 record uploaded ( in the assign fields step , I did not choose "fields names at start of file" and also saved the file with tab delimited text format without field names), it shows as
Transactions Read: 2
Records Read: 2
Transactions Written: 2
Records Written: 2
I uploaded only one record but it reads as 2 records and can not figure out why 2 records?
Also when I checked display converted data , it shows 2 records .
First record shows
TCODE Transaction Code IE01
RECORDNAME IBIP: Name of the Data Transfer Record IBIPEQUI
EQUNR Equipment Number
DATSL Date valid from 05072010
EQTYP Equipment category H
EQKTX Description of technical object PNEUMATIC PIPE BENDER
BEGRU Technical object authorization group
EQART Type of Technical Object MECH-PRESS
GROES Size/dimension 1000X500X1500MM
INVNR Inventory number
BRGEW Gross Weight : IBIP Character Structure 50
GEWEI Weight Unit KG
ELIEF Vendor number
ANSDT Acquisition date
ANSWT Acquisition Value: IBIP Character Structure
All the fields following this , are blank.
2nd record shows
TCODE Transaction Code IE01
RECORDNAME IBIP: Name of the Data Transfer Record IBIPEQUI
EQUNR Equipment Number 2009
DATSL Date valid from
EQTYP Equipment category S
EQKTX Description of technical object 1006324
BEGRU Technical object authorization group
EQART Type of Technical Object
GROES Size/dimension 20100406
uploaded values are jumbled in 1st and 2nd record.
Hope to receive your valuable ideas for finding out the reason and corrective action required.
Rgds,
Rajesh
I
Edited by: Rajesh63 on Jul 6, 2010 10:37 PM
Maybe you are looking for
-
How determine page size by opening PDF file in binary mode
Hi, I have to print PDF file but I would like to know the page size of the PDF file. What I have to verify (section, parameters) in order to know the page size? (Letter, Legal) Thanks! FE
-
Re : Organizational data for inter-company billing
Hi While doing intercompany settings (img - enterprice structure - SD - assign sales org - disribution plant) i am getting the following error " Organizational data for inter-company billing missing in plant SUDA " How to solve. Thanks Anto
-
dear folks, I have created a Process from an exe this exe prints out something to the screen in the beginning as the following(matlab code) //in the beginning fprintf('status=0.1\n'); //does more workI monitor what this process prints out by doing th
-
Can anyone tell me how to fix this in lay-man's terms?
Hi. I've installed and uninstalled the flashplayer on both the 32 bit and 64 bit Internet Explorer versions I have. You tube and all things that play youtube videos will not work. I click on a video and get a black screen and when I right click it
-
Reminders window won't show up after clicking in notifications center
After clicking a notificytion in notifications center on Mavericks the APP Reminders opens but the application window is not showing up. Allways worked like a charme but not any longer for me. I tried to: 1) uncheck the iClound sync for Reminders whi