‎2010 Oct 28 9:22 AM
Dear Experts,
I hv done recording in shdb fo tcode cj02.
i hv written driver program for the same. when i run the program, no data is getting updated, though it goes through all the fields captured in recording.
it gives the following msgs.
CALL_TRANSACTION CJ02 Return code = 0 RECORD: 0
S Field PRPS-USR04 (1) input value is longer than screen field
S Field PRPS-USR06 (1) input value is longer than screen field
S Data not changed
Regards,
Jaspal
Moderator message: please do not use SMS speak.
Edited by: Thomas Zloch on Oct 28, 2010 11:03 AM
‎2010 Oct 28 10:12 AM
You got a message on numeric user fields of WBS, I suppose you used a MOVE to fill BDCDATA-FVAL field, so you got a 0000...0000000000001234.00 value, right justified with zero left padding (field is 132 character long...) where a 1234.00 is expected,
As a result you always pass a zero value, never changing the data.
You can
- use a local temporary character type variable to reduce length of data (To get the length of the variable to use -> SE11 / PRPS / data elements / domains and get output length)
- Programmatically remove leading zeroes to FVAL.
- use a WRITE (with CURRENCY of UNIT when required) and not a MOVE
Regards,
Raymond
‎2010 Oct 28 10:12 AM
You got a message on numeric user fields of WBS, I suppose you used a MOVE to fill BDCDATA-FVAL field, so you got a 0000...0000000000001234.00 value, right justified with zero left padding (field is 132 character long...) where a 1234.00 is expected,
As a result you always pass a zero value, never changing the data.
You can
- use a local temporary character type variable to reduce length of data (To get the length of the variable to use -> SE11 / PRPS / data elements / domains and get output length)
- Programmatically remove leading zeroes to FVAL.
- use a WRITE (with CURRENCY of UNIT when required) and not a MOVE
Regards,
Raymond
‎2010 Oct 28 11:13 AM
Thanks for ur reply Raymond.
i hv not used MOVE statement to fill BDCDATA-FVAL field. I hv not make any changes in INCLUDE bdcrecx1 include file.
Can u tell me, while recording, after entered all the data , when i choose save, is this save will also be captured???
Regards,
JAspal
‎2010 Oct 28 12:25 PM
The form BDC_FIELD of bdcrecx1 perform an implicit conversion of data to a character field (using an [COMPUTE] BDCDATA-FVAL = received parameter) Map the data before calling this form to a field of correct length. (There is not need for character fields, but you may require such pogrammaticaly mapping for any field with conversion, where external and internal format differ : amout, quantity, date, fields with special conversion-exit like material number, WBS element and the like, especially if your program read data from database table.)
Tips: usually i use my own bdc_field form replacing the compute with a write statement.
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
WRITE fval TO bdcdata-fval.
APPEND bdcdata.
ENDFORM.
FORM bdc_field_qty USING fnam fval unit.
CLEAR bdcdata.
bdcdata-fnam = fnam.
WRITE fval UNIT unit TO bdcdata-fval.
APPEND bdcdata.
ENDFORM.
FORM bdc_field_amt USING fnam fval curr.
CLEAR bdcdata.
bdcdata-fnam = fnam.
WRITE fval CURRENCY curr TO bdcdata-fval.
APPEND bdcdata.
ENDFORM.Ref: [Conversion Rules for Elementary Data Types|http://help.sap.com/abapdocu_70/en/ABENCONVERSION_ELEMENTARY.htm]
Yes, you should have a value for OK_CODE field in the recording. in you generated program there should be something like
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'. " or BUCH or any similar function codeReports generated by SHDB are not always "final" versions of a program.
Also, try to put a breakpoint before CALL TRANSACTION and check bdcdata content.
Regards,
Raymond