Pass text to Number/Quantity field
Hi All,
I need to pass text to a number field which in turn needs to be displayed in drop down list.
Is there any way I can achieve this?
Kindly advise.
Thanks,
Vinodha.R
Hi Vinodh,
If you have declared the field type as numeric and try to enter text value then you will get the error.
So, i would suggest to change the field type to CHAR with required length and use it.
Regards,
Sudeesh Soni
Similar Messages
-
Adding quantity field for the same material number in Table control
Hello Experts,
I have an requirement, where I need to add the quantity field when the material number is repeated in a table control.
Here I show the pop-up message "Material already exists, do you want to add the quantity". If the user clicks on Yes I need to add the quantity.
I created the pop-up message using the FM " POPUP_TO_CONFIRM" and tried to add the quantity filed using COLLECT statement but I couldn't because my non-numeric field value will be different and it will insert new entry with same material in my internal table.
I have a z data base table & internal table with the below fields in it.
Best Regards,
Manihi deepthi,
chk a sample one which will help u. <b><i>f4 hlp in table control</i></b>
* Screen flow logic........
PROCESS BEFORE OUTPUT.
*MODULE PBO_MODULE.
PROCESS AFTER INPUT.
*MODULE PAI_MODULE.
PROCESS ON VALUE-REQUEST. "F4
FIELD EKPO-EBELP MODULE help_ekpo.
* populate screen field from within PROCESS ON VALUE-REQUEST(F4) call
*& Module help_responsibility INPUT
* text
MODULE help_ekpo INPUT.
**Transport values to table dynpro/screen table control
DATA: l_stepl LIKE sy-stepl,
l_indx LIKE sy-stepl.
DATA: dynpfields LIKE dynpread OCCURS 5 WITH HEADER LINE.
* Adjust for scroling within table control
CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
povstepl = l_stepl
EXCEPTIONS
stepl_not_found = 0
OTHERS = 0.
l_indx = tc_ekpotable-top_line + l_stepl - 1.
"tc_ekpotable should already have been declared
REFRESH dynpfields.
CLEAR dynpfields.
dynpfields-fieldname = 'EKPO-EBELN'.
dynpfields-fieldvalue = '00010' "wa_ekpo-ebeln.
dynpfields-stepl = l_stepl.
APPEND dynpfields.
dynpfields-fieldname = 'EKPO-EBELP'.
dynpfields-fieldvalue = '00020' "wa_ekpo-ebelp.
dynpfields-stepl = l_stepl.
APPEND dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'SAPLZZ_EKKO' "Program name
dynumb = '0100' "Screen number
TABLES
dynpfields = dynpfields
EXCEPTIONS
OTHERS = 0.
ENDMODULE. " help_ekpo INPUT
rgds
Anver
<b><i>if hlped kindly mark points</i></b> -
Passing quantity field into RF Module
Hi,
From java application we are passing quantity field (parameters) to bapi goods mvt create . we have applied all right justified , mulitiplying options but unable to post a document. they are using string datatype & we r using the quant ..we have tried with all options with string datatype it is accepting at our end but from java side when they are passing Func. module is not accepting...any clue on it..any fm
Thanks & Regards
Gaurav SaxenaYes U r right but I had made it string datatype and then right alligned and then again pass it to quantity field it is accepting at our end but failing while java application execution. it is giving the error " Maintain serial number for total quantity " that means it is taking some more quantity instead of 1 ( while passing i serial no.) something like 10,100.... so any suggestion..
-
Quantity field in at user-command
Hi,
I have declared the quantity field V_QTY TYPE AFKO-GAMNG.
I am passing the quantity field values from the internal table which is having data for the quantity field to V_QTY. but the field V_QTY is not filling with the quantity.
Instead of the quantity, it is taking the * value into the field.
I am not using any control break commands in my coding. I am attaching the code also. can anyone guide me .
Report ztest.
TABLES: AFKO, " Order Header
AFPO, " Order Item
AUFK, " Order Master
RESB,
AFVC, " Order Operation w/i an Order
AFVV, " Qty/Dates/values in an Operation
CRHD, " Work Center
MARA, " Material Master
MAKT, " Material Description
AUSP, " Characteristic Values
CABN, " Characteristic
PLPO, " Task list-operation/activity
PLFL, " Task list - sequences
TJ02T, " System status texts
JEST. " Individual Object Status
TYPE-POOLS:SLIS.
TYPE-POOLS:ICON.
DATA:CHECK(1),
TOTAL(7) VALUE 'TOTAL :',
W_AMOUNT TYPE GAMNG VALUE 0.
TYPES:BEGIN OF T_AFKO,
CHECK,
AUFNR TYPE AFKO-AUFNR,
GLTRP TYPE AFKO-GLTRP,
GSTRP TYPE AFKO-GSTRP,
GAMNG TYPE AFKO-GAMNG,
PLNBEZ TYPE AFKO-PLNBEZ,
END OF T_AFKO.
DATA:I_AFKO TYPE STANDARD TABLE OF T_AFKO,
W_AFKO LIKE LINE OF I_AFKO.
DATA:I_AFKO1 TYPE STANDARD TABLE OF T_AFKO,
W_AFKO1 LIKE LINE OF I_AFKO1.
DATA:PONUM TYPE AFKO-AUFNR,
STDATE TYPE AFKO-GLTRP,
FIDATE TYPE AFKO-GSTRP,
QUANTY TYPE AFKO-GAMNG,
MATER TYPE AFKO-PLNBEZ,
DESCR TYPE MAKT-MAKTX,
INDEX TYPE SY-INDEX,
COUNT(3) VALUE '0'.
TYPES:BEGIN OF T_FINAL,
CHECK,
LIGHT TYPE ICON-ID,
MATNR TYPE RESB-MATNR,
AUFNR TYPE AFKO-AUFNR,
GLTRP TYPE AFKO-GLTRP,
GSTRP TYPE AFKO-GSTRP,
GAMNG TYPE AFKO-GAMNG,
PLNBEZ TYPE AFKO-PLNBEZ,
MAKTX TYPE MAKT-MAKTX,
END OF T_FINAL.
DATA:I_FINAL TYPE STANDARD TABLE OF T_FINAL,
W_FINAL LIKE LINE OF I_FINAL,
I_FINAL1 TYPE STANDARD TABLE OF T_FINAL,
W_FINAL1 LIKE LINE OF I_FINAL1.
TYPES:BEGIN OF T_CRHD,
OBJID TYPE CRHD-OBJID,
ARBPL TYPE CRHD-ARBPL,
END OF T_CRHD.
DATA:I_CRHD TYPE STANDARD TABLE OF T_CRHD,
W_CRHD LIKE LINE OF I_CRHD.
TYPES:BEGIN OF T_AFVC,
AUFPL TYPE AFVC-AUFPL,
ARBID TYPE AFVC-ARBID,
END OF T_AFVC.
DATA:I_AFVC TYPE STANDARD TABLE OF T_AFVC,
W_AFVC LIKE LINE OF I_AFVC.
TYPES:BEGIN OF T_ITEM,
MATNR TYPE RESB-MATNR, " Component Matl Number
MAKTX TYPE MAKT-MAKTX, " Matl Desc for Component
BDMNG TYPE RESB-BDMNG, " Component Req'd Qty
END OF T_ITEM.
DATA:I_ITEM TYPE STANDARD TABLE OF T_ITEM,
W_ITEM LIKE LINE OF I_ITEM.
TYPES:BEGIN OF T_RESB,
MATNR TYPE RESB-MATNR,
AUFNR TYPE RESB-AUFNR,
BDMNG TYPE RESB-BDMNG,
END OF T_RESB.
DATA:I_RESB TYPE STANDARD TABLE OF T_RESB,
W_RESB LIKE LINE OF I_RESB.
DATA:I_MAKT TYPE STANDARD TABLE OF MAKT,
W_MAKT LIKE LINE OF I_MAKT,
I_MAKT1 TYPE STANDARD TABLE OF MAKT,
W_MAKT1 LIKE LINE OF I_MAKT1.
TYPES:BEGIN OF T_AUFK,
AUFNR TYPE AUFK-AUFNR,
AUART TYPE AUFK-AUART,
WERKS TYPE AUFK-WERKS,
OBJNR TYPE AUFK-OBJNR,
END OF T_AUFK.
DATA:I_JEST TYPE STANDARD TABLE OF JEST,
W_JEST LIKE LINE OF I_JEST.
DATA:I_AUFK TYPE STANDARD TABLE OF T_AUFK,
W_AUFK LIKE LINE OF I_AUFK.
DATA:V_QTY TYPE AFKO-GAMNG,
LINES TYPE I,
V_AUFNR TYPE AFKO-AUFNR.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS:
P_WERKS TYPE AUFK-WERKS OBLIGATORY MEMORY ID WRK, " PLANT
P_AUART TYPE AUFK-AUART OBLIGATORY. "ORDER TYPE
SELECT-OPTIONS: S_PLNBEZ FOR AFKO-PLNBEZ. "material
PARAMETERS: P_ARBPL TYPE CRHD-ARBPL OBLIGATORY. "Work center
SELECT-OPTIONS:
S_GSTRP FOR AFKO-GSTRP OBLIGATORY. "ORDER BASIC START DATE
*s_gltrp FOR afko-gltrp OBLIGATORY, "ORDER BASIC FINISH DATE
*s_gstrs FOR afko-gstrs, "ORDER SCHEDULE START DATE
*s_gltrs FOR afko-gltrs. "ORDER SCHEDULE FINISH DATE
PARAMETERS:P_MATNR TYPE RESB-MATNR.
SELECTION-SCREEN END OF BLOCK B1.
*ALV data declarations
DATA: I_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV,
W_FIELDCATALOG LIKE LINE OF I_FIELDCATALOG,
S_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
GD_REPID LIKE SY-REPID VALUE SY-REPID,
T_HEADING TYPE SLIS_T_LISTHEADER,
IT_LISTHEADER TYPE SLIS_T_LISTHEADER,
W_KEYINFO TYPE SLIS_KEYINFO_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV,
IT_SORT TYPE SLIS_T_SORTINFO_ALV,
IT_TITLE_BASIC TYPE
LVC_TITLE VALUE 'SELECTION OF PRODUCTION ORDERS',
IT_TITLE_ITEM TYPE LVC_TITLE VALUE 'MIXING REPORT'.
DATA: PO TYPE AUFNR,
P_SELFIELD TYPE SLIS_SELFIELD.
DATA: I_EVENTS TYPE SLIS_T_EVENT,
W_EVENTS LIKE LINE OF I_EVENTS.
CLEAR: W_EVENTS.
REFRESH: I_EVENTS.
DATA:I_HEADER TYPE SLIS_T_LISTHEADER,
W_HEADER LIKE LINE OF I_HEADER.
BEGIN OF CODE FOR ALV_HIERSEQ_LIST*************
TYPES:BEGIN OF T_HHEADER,
EXPAND,
MATNR TYPE RESB-MATNR,
MAKTX TYPE MAKT-MAKTX,
V_QTY,
END OF T_HHEADER.
DATA:I_HHEADER TYPE STANDARD TABLE OF T_HHEADER,
W_HHEADER LIKE LINE OF I_HHEADER.
TYPES:BEGIN OF T_HITEM,
CHECK,
MATNR TYPE RESB-MATNR,
AUFNR TYPE AFKO-AUFNR,
GAMNG TYPE AFKO-GAMNG,
PLNBEZ TYPE AFKO-PLNBEZ,
MAKTX TYPE MAKT-MAKTX,
GLTRP TYPE AFKO-GLTRP,
GSTRP TYPE AFKO-GSTRP,
END OF T_HITEM.
DATA:I_HITEM TYPE STANDARD TABLE OF T_HITEM,
W_HITEM LIKE LINE OF I_HITEM.
END OF CODE FOR ALV_HIERSEQ_LIST ****************************
INITIALIZATION.
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_LAYOUT.
*Start-of-selection.
START-OF-SELECTION.
PERFORM GET_EVENTS.
PERFORM GET_DATA.
END-OF-SELECTION.
PERFORM DISPLAY_ALV_REPORT.
*& Form BUILD_FIELDCATALOG
text
FORM BUILD_FIELDCATALOG.
CLEAR W_FIELDCATALOG .
W_FIELDCATALOG-COL_POS = '1'.
W_FIELDCATALOG-FIELDNAME = 'MATNR'.
W_FIELDCATALOG-TABNAME = 'I_HHEADER'.
W_FIELDCATALOG-SELTEXT_M = 'Phantom Material'.
W_FIELDCATALOG-ROLLNAME = 'MATNR'.
W_FIELDCATALOG-OUTPUTLEN = '20'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG .
W_FIELDCATALOG-COL_POS = '2'.
W_FIELDCATALOG-FIELDNAME = 'MAKTX'.
W_FIELDCATALOG-TABNAME = 'I_HHEADER'.
W_FIELDCATALOG-SELTEXT_M = 'Phantom Material Description'.
W_FIELDCATALOG-ROLLNAME = 'MAKTX'.
W_FIELDCATALOG-OUTPUTLEN = '40'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG .
W_FIELDCATALOG-COL_POS = '3'.
W_FIELDCATALOG-FIELDNAME = 'BDMNG'.
W_FIELDCATALOG-TABNAME = 'I_HHEADER'.
W_FIELDCATALOG-OUTPUTLEN = '20'.
W_FIELDCATALOG-SELTEXT_M = 'Total Batch qty:'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG .
W_FIELDCATALOG-COL_POS = '1'.
W_FIELDCATALOG-SELTEXT_M = 'Selection'.
W_FIELDCATALOG-FIELDNAME = 'CHECK'.
W_FIELDCATALOG-TABNAME = 'I_HITEM'.
W_FIELDCATALOG-EDIT = 'X'.
W_FIELDCATALOG-CHECKBOX = 'X'.
W_FIELDCATALOG-INPUT = 'X'.
W_FIELDCATALOG-HOTSPOT = 'X'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG .
W_FIELDCATALOG-COL_POS = '2'.
W_FIELDCATALOG-FIELDNAME = 'MATNR'.
W_FIELDCATALOG-TABNAME = 'I_HITEM'.
W_FIELDCATALOG-ROLLNAME = 'MATNR'.
W_FIELDCATALOG-OUTPUTLEN = '12'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG .
W_FIELDCATALOG-COL_POS = '2'.
W_FIELDCATALOG-FIELDNAME = 'AUFNR'.
W_FIELDCATALOG-TABNAME = 'I_HITEM'.
W_FIELDCATALOG-ROLLNAME = 'AUFNR'.
W_FIELDCATALOG-OUTPUTLEN = '12'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
W_FIELDCATALOG-COL_POS = '3'.
W_FIELDCATALOG-SELTEXT_M = 'PO Qty'.
W_FIELDCATALOG-FIELDNAME = 'GAMNG'.
W_FIELDCATALOG-ROLLNAME = 'GAMNG'.
W_FIELDCATALOG-OUTPUTLEN = '20'.
W_FIELDCATALOG-TABNAME = 'I_HITEM'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
W_FIELDCATALOG-COL_POS = '4'.
W_FIELDCATALOG-SELTEXT_M = 'Header Material'.
W_FIELDCATALOG-FIELDNAME = 'PLNBEZ'.
W_FIELDCATALOG-ROLLNAME = 'MATNR'.
W_FIELDCATALOG-OUTPUTLEN = '20'.
W_FIELDCATALOG-TABNAME = 'I_HITEM'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG.
W_FIELDCATALOG-COL_POS = '5'.
W_FIELDCATALOG-SELTEXT_M = 'Material Description'.
W_FIELDCATALOG-FIELDNAME = 'MAKTX'.
W_FIELDCATALOG-ROLLNAME = 'MAKTX'.
W_FIELDCATALOG-OUTPUTLEN = '40'.
W_FIELDCATALOG-TABNAME = 'I_HITEM'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG .
W_FIELDCATALOG-COL_POS = '6'.
W_FIELDCATALOG-FIELDNAME = 'GSTRP'.
W_FIELDCATALOG-TABNAME = 'I_HITEM'.
W_FIELDCATALOG-ROLLNAME = 'CO_GSTRP'.
W_FIELDCATALOG-OUTPUTLEN = '10'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
CLEAR W_FIELDCATALOG .
W_FIELDCATALOG-COL_POS = '7'.
W_FIELDCATALOG-FIELDNAME = 'GLTRP'.
W_FIELDCATALOG-TABNAME = 'I_HITEM'.
W_FIELDCATALOG-ROLLNAME = 'CO_GLTRP'.
W_FIELDCATALOG-OUTPUTLEN = '10'.
W_FIELDCATALOG-SELTEXT_M = 'Basic End Date'.
APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
ENDFORM. "BUILD_FIELDCATALOG
*& Form get_events
text
FORM GET_EVENTS.
CLEAR : W_EVENTS, I_EVENTS[].
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = I_EVENTS.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO W_EVENTS.
IF SY-SUBRC EQ 0.
MOVE 'TOP_OF_PAGE' TO W_EVENTS-FORM.
MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.
ENDIF.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
INTO W_EVENTS.
IF SY-SUBRC EQ 0.
MOVE 'SUB_USER_COMMAND' TO W_EVENTS-FORM.
MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.
ENDIF.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_PF_STATUS_SET
INTO W_EVENTS.
IF SY-SUBRC EQ 0.
MOVE 'PF_STATUS_SET' TO W_EVENTS-FORM.
MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.
ENDIF.
ENDFORM. "get_events
*& Form build_layout
text
FORM BUILD_LAYOUT.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
GD_LAYOUT-ZEBRA = 'X'.
W_KEYINFO-HEADER01 = 'MATNR'.
W_KEYINFO-ITEM01 = 'MATNR'.
GD_LAYOUT-TOTALS_TEXT = 'Totals'(201).
GD_LAYOUT-EXPAND_FIELDNAME = 'EXPAND'.
ENDFORM. " BUILD_LAYOUT
*& Form data_retrieval
text
FORM GET_DATA.
IF p_matnr IS NOT INITIAL.
SELECT MATNR
AUFNR
BDMNG
FROM RESB INTO TABLE I_RESB
WHERE DUMPS = 'X'.
AND matnr = p_matnr.
SORT I_RESB BY MATNR AUFNR.
ENDIF.
SELECT * FROM JEST INTO CORRESPONDING FIELDS OF TABLE I_JEST
WHERE STAT = 'I0002'
AND INACT = ' '.
SELECT OBJID
ARBPL
FROM CRHD INTO TABLE I_CRHD WHERE ARBPL = P_ARBPL.
IF NOT I_CRHD[] IS INITIAL.
SELECT AUFPL
ARBID
FROM AFVC INTO TABLE I_AFVC
FOR ALL ENTRIES IN I_CRHD
WHERE ARBID = I_CRHD-OBJID.
ENDIF.
IF NOT I_AFVC[] IS INITIAL.
SELECT AUFNR
GLTRP
GSTRP
GAMNG
PLNBEZ
FROM AFKO INTO CORRESPONDING FIELDS OF TABLE I_AFKO
FOR ALL ENTRIES IN I_AFVC
WHERE AUFPL = I_AFVC-AUFPL
AND GSTRP IN S_GSTRP.
SORT I_AFKO BY AUFNR.
ENDIF.
IF NOT I_AFKO[] IS INITIAL.
SELECT AUFNR
AUART
WERKS
OBJNR
FROM AUFK INTO TABLE I_AUFK
FOR ALL ENTRIES IN I_AFKO
WHERE AUFNR = I_AFKO-AUFNR
AND AUART = P_AUART
AND WERKS = P_WERKS.
SORT I_AUFK BY AUFNR OBJNR.
SELECT * FROM MAKT INTO TABLE I_MAKT1
FOR ALL ENTRIES IN I_AFKO
WHERE MATNR = I_AFKO-PLNBEZ
AND SPRAS = SY-LANGU.
SORT I_MAKT1 BY MATNR.
ENDIF.
IF NOT I_RESB[] IS INITIAL.
SELECT * FROM MAKT INTO TABLE I_MAKT
FOR ALL ENTRIES IN I_RESB
WHERE MATNR = I_RESB-MATNR
AND SPRAS = SY-LANGU.
SORT I_MAKT BY MATNR.
ENDIF.
CLEAR W_HHEADER-BDMNG.
***BEGIN OF PHANTOM MATERIAL HEADER INTERNAL TABLE***
CLEAR W_AUFK.
CLEAR W_RESB.
LOOP AT I_RESB INTO W_RESB.
W_HHEADER-MATNR = W_RESB-MATNR.
READ TABLE I_MAKT INTO W_MAKT
WITH KEY MATNR = W_RESB-MATNR BINARY SEARCH.
W_HHEADER-MAKTX = W_MAKT-MAKTX.
APPEND W_HHEADER TO I_HHEADER.
MODIFY I_HHEADER FROM W_HHEADER INDEX SY-TABIX.
CLEAR W_HHEADER.
CLEAR W_RESB.
SORT I_HHEADER BY MATNR.
DELETE ADJACENT DUPLICATES FROM I_HHEADER.
ENDLOOP.
****END OF PHANTOM MATERIAL HEADER INTERNAL TABLE***
**BEGIN OF PHANTOM MATERIAL ITEM DETAILS***************
IF NOT I_HHEADER[] IS INITIAL.
LOOP AT I_HHEADER INTO W_HHEADER.
LOOP AT I_RESB INTO W_RESB WHERE MATNR = W_HHEADER-MATNR.
IF SY-SUBRC = 0.
READ TABLE I_AUFK INTO W_AUFK
WITH KEY AUFNR = W_RESB-AUFNR.
READ TABLE I_JEST INTO W_JEST
WITH KEY OBJNR = W_AUFK-OBJNR.
IF SY-SUBRC = 0.
W_HITEM-CHECK = CHECK.
W_HITEM-MATNR = W_HHEADER-MATNR.
READ TABLE I_AFKO INTO W_AFKO
WITH KEY AUFNR = W_AUFK-AUFNR BINARY SEARCH.
W_HITEM-AUFNR = W_AFKO-AUFNR.
W_HITEM-PLNBEZ = W_AFKO-PLNBEZ.
READ TABLE I_MAKT1 INTO W_MAKT1
WITH KEY MATNR = W_AFKO-PLNBEZ.
W_HITEM-MAKTX = W_MAKT1-MAKTX.
W_HITEM-GLTRP = W_AFKO-GLTRP.
W_HITEM-GSTRP = W_AFKO-GSTRP.
W_HITEM-GAMNG = W_AFKO-GAMNG.
APPEND W_HITEM TO I_HITEM.
MODIFY I_HITEM FROM W_HITEM INDEX SY-TABIX.
SORT I_HITEM BY AUFNR.
CLEAR W_HITEM.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
***********END OF PHANTOM MATERIAL ITEM DETAILS.*********************
ENDFORM. "get_item_DETAILS
*& Form top_of_page
text
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_HEADER
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM. " alv_top_of_page
*& Form user_command
text
-->P_UCOMM text
-->P_SELFIELD text
FORM DISPLAY_ALV_REPORT.
SORT I_HHEADER BY MATNR.
SORT I_HITEM BY MATNR AUFNR.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'
I_CALLBACK_USER_COMMAND = 'SUB_USER_COMMAND'
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = I_FIELDCATALOG
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = I_EVENTS[]
IT_EVENT_EXIT =
I_TABNAME_HEADER = 'I_HHEADER'
I_TABNAME_ITEM = 'I_HITEM'
i_structure_name_header =
i_structure_name_item =
IS_KEYINFO = W_KEYINFO
IS_PRINT =
IS_REPREP_ID =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB_HEADER = I_HHEADER
T_OUTTAB_ITEM = I_HITEM
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "display_alv_report
*****BEGIN OF CUMMILATIVE QUANTITY***********************
FORM PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.
BREAK POINT.
SET PF-STATUS 'STANDARD' EXCLUDING EXTAB.
ENDFORM. "PF_STATUS_SET
*& Form SUB_USEMR_COMMAND
text
-->P_UCOMM text
-->P_SELFIELD text
FORM SUB_USER_COMMAND USING P_UCOMM LIKE SY-UCOMM
P_SELFIELD TYPE SLIS_SELFIELD.
CASE SY-UCOMM.
WHEN 'SUMM'.
CLEAR W_HITEM.
CLEAR W_HHEADER-V_QTY.
P_SELFIELD-REFRESH = 'X'.
DATA:LV_TABIX TYPE SY-TABIX.
LOOP AT I_HITEM INTO W_HITEM.
READ TABLE I_HHEADER INTO W_HHEADER
WITH KEY MATNR = W_HITEM-MATNR BINARY SEARCH.
IF SY-SUBRC = 0.
LV_TABIX = SY-TABIX.
IF W_HITEM-CHECK = 'X'.
W_HHEADER-V_QTY = W_HHEADER-V_QTY + W_HITEM-GAMNG.
MODIFY I_HHEADER FROM W_HHEADER
INDEX LV_TABIX." TRANSPORTING V_QTY.
ENDIF.
ENDIF.
ENDLOOP.
ENDCASE.
ENDFORM. "USER_COMMAND
*********END OF CUMMILATIVE QUANTITY
Thanks in advance.
Ramesh.Hello Ramesh,
Check your declerations,
In internal table I_HHEADER , the quantity field is of character type. And in internal table I_HITEM, the field GAMNG is of type quantity. There will be type mismatch.Correct it and see if it works.
Regards -
How to use TRANSFER itabTO FILE if itab having quantity field
Hello,
i am using ''TRANSFER itabTO FILE'' for transfer records(itab) into unix file
if itab having quantity field or currency field then it gives error.that it must contain
char fields.
what can i do now?
Please tell me.............Check this out.
TRANSFER
Syntax
TRANSFER dobj TO dset [LENGTH len]
[NO END OF LINE].
Extras:
1. ... LENGTH len
2. ... NO END OF LINE
Effect
This statement passes the content of data object dobj to the file specified in dset.<b> For dobj, you can specify data objects with elementary data types and flat structures. In Unicode programs, dobj must be character-type if the file was opened as a text file (this restriction does not apply to legacy text files). </b>
dset is expected to be a character-type data object that contains the platform-specific name of the file. The content is written to the file from the current file pointer. After the transfer, the file pointer is positioned after the data that was added. You can use addition LENGTH to restrict the number of characters or bytes transferred
In a Unicode program, the file for writing, appending, or changing must be open. Otherwise, a treatable exception occurs.
If the file was not yet opened in a non-Unicode programm, it is implicitly opened using the statement
OPEN DATASET dset FOR OUTPUT IN BINARY MODE.
as a binary file for writing. If the system accesses an invalid file, a treatable exception is raised.
The Influence of Access Type
The access type defined in statement OPEN DATASET has the following effect on the transfer:
A file opened for reading using FOR INPUT cannot be written in Unicode programs. In non-Unicode programs, TRANSFER writes in a file opened for reading using FOR INPUT in exactly the same way as a file openedfor changing using FOR UPDATE.
In a file opened for writing using FOROUTPUT, the system writes to the file from the current file pointer. If the file pointer is positioned after the current start of the file, the file is pre-filled with hexadecimal 0 from the start of the file to the file pointer.
In a file opened for appending using FOR APPENDING, the system writes to the file from the current file pointer, which is always at the end of the file.
In a file opened for changing using FOR UPDATE, the system writes to the file from the current file pointer. If the file pointer is positioned after the end of the file, the file is pre-filled with hexadecimal 0 between the end of the file and the file pointer position.
Note
Prior to release 6.10: If parts of a file were to be overwritten, it was only possible to write to a file opened for reading. This is not allowed in Unicode programs. As of release 6.10 and later, you can open a file for changing which is the recommended procedure also for non-Unicode programs. -
ALV QUANTITY field Geting converted into decimals ?
Hi All ,
I have developed an alv report .In that the quantity field is made editable after editing the quantity when i save it .It gets converted into decimals.Suppose if i give 77 its getting reflected as .077 all the field name ,table name ,reference field name, reference table name, quantity field data type has been passed but the problem persists.If there is any one whos has come across this kind of scenario please share your thoughts on this.
Best Regards,
SreeramHi Sreeram,
I am not gettin this issue. See below code :
If you are gettiing the same issue with the below code then it has something to do with your user settings.
Go to Menu Item System -> User Profile -> Own Data -> Defaults ->Decimal Notation.
Set it to 1,234,567.89 and save. Now try the program again.
REPORT z_test.
TYPE-POOLS: slis.
TYPES : BEGIN OF ty_ekpo,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
ktmng TYPE ktmng,
menge TYPE bstmg,
END OF ty_ekpo.
DATA: it_ekpo TYPE TABLE OF ty_ekpo,
it_fieldcat TYPE slis_t_fieldcat_alv.
SELECT ebeln ebelp ktmng menge
FROM ekpo
INTO TABLE it_ekpo
UP TO 20 ROWS.
PERFORM add_fieldcat USING 'EBELN'.
PERFORM add_fieldcat USING 'EBELP'.
PERFORM add_fieldcat USING 'KTMNG'.
PERFORM add_fieldcat USING 'MENGE'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
FORM add_fieldcat USING p_fieldname TYPE slis_fieldcat_alv-fieldname.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-tabname = 'IT_EKPO'.
wa_fieldcat-ref_fieldname = p_fieldname.
wa_fieldcat-ref_tabname = 'EKPO'.
IF p_fieldname EQ 'KTMNG'.
wa_fieldcat-edit = 'X'.
ENDIF.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. " ADD_FIELDCAT
Regards,
Jovito -
The source and target structure have a different number of fields
Hi,
I am new to workflow and I am trying to create an attachment in Workflow (SAP ECC 6.0) and pass it through to a User Decision (User Decision works fine) however the workflow is failing on the attachment step with u2018The source and target structure have a different number of fieldsu2019. The bindings check ok. Please see details below.
I have used document u2018Creating Attachments to Work Items or to User Decisions in Workflowsu2019 by Ramakanth Reddy for guidance. Thanks in advance.
1) Workflow containers (SWDD)
WORKITEMID (import)
ZSWR_ATT_ID (export)
SOFM (export)
2) Task Container (PFTC)
1 Import parameter defined u2013 WORKITEMID (swr_struct-workitemid)
2 Export parameters defined
- SOFM (Ref. obj. type SOFM)
- ZSWR_ATT_ID (swr_att_id-doc_id)
Binding task -> Method
Binding for 1 parameter (import) defined
Task <- Method
Binding for 2 parameters (export) defined
3) Z BOR object created with a Method, Method Parameters and Event (SWO1)
1 import parameter defined
2 export parameters defined
Method calls FM SSF_FUNCTION_MODULE_NAME, CONVERT_OTF, SCMS_XSTRING_TO_BINARY and SAP_WAPI_ATTACHMENT_ADD
Workflow is triggered by FM SAP_WAPI_CREATE_EVENT, Return_code = 0
Event_id = 00000000000000000001
Test results
A) Triggered by ABAP/ FM SAP_WAPI_CREATE_EVENT - SWI2_DIAG results
Work item 14791: object <z bor object name> method <method name> cannot be executed. The source and target structure have a different number of fields (this message is repeated 3 times). Error handling for work item 14791. No errors occurred -> details in long text (message is repeated 3 times).
Message no. WL821, OL383, WL050 in long text
B) Z BOR Test method <execute>
Enter workitem id.
Runtime error - Data objects in Unicode programs cannot be converted. The statement "MOVE src TO dst" requires that the operands "dst" and "src" are convertible. Since this statement is in a Unicode program, the special conversion rules for Unicode programs apply.
In this case, these rules were violated.
Program SAPLSWCD
Include LSWCDF00
Row 475
Module type (FORM)
Module Name MOVE_CONTAINER_TO_VALUE
C) Z BOR Test method <debugging>
Enter workitem id.
SAP_WAPI_ATTACHMENT_ADD, return_code = 0, message_lines = Attachment created
both swc_set_element container work ok
Runtime error occurs after end_method executed. Data objects in Unicode programs cannot be converted.
D) Workflow test
Enter workitem id <execute>
Task started> Workflow log> Status = Error
Workflow errors in Attachment step (however Office document can be viewed in details for step).Problem has now been resolved. Problem was related to use of swr_att_id structure and swc_set_element statement in BOR program - problem resolved by only setting w/f container to swr_att_id-doc_id.
-
In smartforms the quantity field is not showing the perfect value .
In smartforms the quantity field is not showing the perfect value because the point is shifting left
insted of showing 8.10 it is showing 80.00.Hi,
Dont use the quantity field same as that it come from interface Fm declare one field for quantity in the global settings and write the logic to pass the value to that field and pass that global value to the particular texts...same is the case with currency fields also.
Regards,
Rohan. -
Short text and number of outline not maintained error in BAPI_ENTRYSHEET_CREATE
Hi Experts,
I am using BAPI BAPI_ENTRYSHEET_CREATE' for creation of service entry sheets.
I passed below data into the respective parameters
Entry Header Sheet -
SHORT_TEXT
THIS IS SAMPLE TEXT
PO_NUMBER
231002130
PO_ITEM
00010
And just executed BAPI, I am able to get the ENTRYSHEET NUMBER.
Next I tried passing below data again
Entry Header Sheet -
SHORT_TEXT
THIS IS SAMPLE TEXT
PO_NUMBER
231002130
PO_ITEM
00010
ENTRYSHEETSERVICES:
QUANTITY
10.000
BASE_UOM
AU
And then executed - I am getting an error saying 'Short text and number of outline not maintained'.
My input file to BAPI contains the structure as PO, Item Number, Short Text for Service Entry sheet and Quantity.
Please suggest if any ideas.
Regards,
RafiHi All,
I resolved this. Please refer screen shots below for solution
Below screen shots show about the data to be passed to BAPI_ENTRYSHEET_CREATE
Regards,
Rafi -
hi,
When i am multiplying
xkomv-kwert = xkomv-kbetr(11.14) * KOMP-MGAME( 1.000 this is one).
it is giving 11140.00 what need to be done, I am aware because of the QUANTITY field, now please tell me
1. Whether I need to pass the UNIT field? HOW?
2. or I need do use some numerator / denominator.
regards,
Prabhu
Prabhuhi Prabhu,
goto the attributes of the program and check if <b>Fixed Point Arithmetic</b> checkbox is checked or not
<b>Fixed point arithmetic</b>
If you mark this checkbox, all caluculations in the program will use
fixed point arithmetic.
If you do not, packed numbers (ABAP/4 type P, Dictionary types CURR, DEC
or QUAN) will be treated as integers when they are used in assignments,
comparisons and calculations, irrespective of the number of decimal
places defined. Intermediate results in arithmetic calculations will
also be rounded to the next whole number. The number of decimal places
defined is only taken into account when you output the answer using the
WRITE statement. -
Handling currency and quantity fields in smartforms
Hi,
can i know how to handle currency and quantity fields in smartforms.
i have to display ZMENG field of VBAP table but it is not getting displayed.
i have given the details in CURRENCY AND QUANTITY tab in the GLOBAL DEFINITIONS.
Thanks,
BJR.Hi
Did u pass that value in the INPUT and OUTPUT parameters where u r calling that field...
if u have not included that in The Currency/Quant Tab will get an Error Message.....
and &VBAP-ZMENG& ..in the text
surya -
Leave quantity field empty in PLD when...
Hi experts,
I have an Item which has no need to be quantified, so i want to leave the quantity field empty when that specific Item is in the rows of any marketing document.
Now I'm struggling with the if-then situation in the PLD.
I don't know how to manage that the quantity field will stay empty in that specific situation.
Is it possible at all? And if it is, is there somebody who can help me with this?
Gtrz,
Miranda.Hello ..
Insist because they still do not understand what the real requirement ... my understanding is that you are using a non-inventoried item with quantity 1, and requires that:
1.la line does not appear or that otherwise
Appears 2.la line with zero quantity.
If it were the case, I could
1. condition all the detail fields to the condition FIELD: FIELD DESCRIPTION == TEXT ARTICLE with the name of the article ... thus the line does not appear when you see this article.
2. field condition the amount to the condition FIELD: QUANTITY == text field with the number "1".
Best regards
Edited by: Paul Ponce on Nov 9, 2009 6:26 PM -
How can we remove the following zeros from quantity field ?
Hi All.
how can we remove the following zeros from quantity field while populating ALV by using FM REUSE_ALV_GRID_DISPLAY ?
eg:getting output zqty = 2.000
but i need zqty = 2.
help me to reslove this issue.
Regards.
jayHi,
While populating the field catlog do the following thing to avoid zeros.
wa_fieldcat-tabname = 'I_OUTPUT'. " Curr
wa_fieldcat-fieldname = 'FWAER'.
wa_fieldcat-seltext_l = text-023.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Thanks,
Khushbu. -
Database error text: invalid number
Hi Gurus,
I am calling a procedure proxy from ECC and it is giving me a short dump:
Error 339 has occurred while executing database procedure
""_SYS_BIC"."Krishna_Demo_Proj.Model/KC_GET_MARA"" on the
current database connection "R/3".
Database error text: invalid number: ''
Triggering statement: "dsql_open_proc"
I have created a table with only one field.
Mapped the Data types after creating the Procedure Proxy
Which data type I need to use? I tried with lots of combinations but, still the same error.
Regards,
Krishna ChauhanHi Srinu,
I have used NVARCHAR 18 and corresponding to that CHAR18 is used.
Please see the attached screen shots.
Regards,
Krishna Chauhan -
Error with quantity field:Datasource Creation Using Function Module method
Problem with DATASOURCE Creation using Function Module method :
I have created a datasource ZSTANDARD_COST_PRICE using Function Module method . The datasource creation is successfull when I remove the quantity field from the Z table . If I dont remove the quantity field from my Z table it gives an error as "Units Field WAERS for field STPRS of datasource ZSTANDARD_COST_PRICE is hidden". I am not able to remove this error . Please someone guide.
Let me know if my explanation is not clear enough.
Thanks in advance,
Neha.
Z table definition is as below :
MATNR MATNR CHAR 18 0 Material Number
BWKEY BWKEY CHAR 4 0 Valuation area
LFGJA LFGJA NUMC 4 0 Fiscal Year of Current Period
STPRS STPRS CURR 11 2 Standard Price " Here the currency field is WAERS and table T001
PEINH PEINH DEC 5 0 Price Unit
VJSTP VJSTP CURR 11 2 Standard price in previous year
VJPEI VJPEI DEC 5 0 Price unit of previous year.
Edited by: Neha Rathi on Jan 30, 2009 3:03 PMHi,
You should add it as one of the main fields as you have added other fields and not as the currency fields...that is..it should be part of the data source and you should be able to see it in RSO2...
Also if added as i said then it will come as new field in the data source...you can either let it be there...or hide it..
also if you want to populate it then you will have to write the code for this fields as well.
Thanks
Ajeet
Maybe you are looking for
-
Error while generating PDF of SF
Dear All, I'm trying to send SF as a PDF attachment, I'm able to send it successfully in Dev Server. In Prd. Server it works successfully in one ID, but in other it the SF func. module gives me an error with subrc EQ 1. On further debugging I found t
-
How do get my ipod to work again after it died
How do i get my ipod to work again after it died and wont charge?
-
How to save the value from JTextFormattedField using TAB key in lostFocus
Can you, please help me with this problem: I want to have saved new value in JTextFormattedField after I use TAB kye. I tried with focusLost, then setting setFocusTraversalKeys etc. It looks simple, but !? Thanks
-
Error when connecting to system
Hi, I have been off topic for quite a while and when I wanted to pick up today, I couldn't connect to the HANA server anymore. I haven't changed any settings since last setup, all I get is the "Error when connecting to system" in the Quick Lauch of t
-
Problem signature: Problem Event Name: BEX Application Name: iTunes.exe Application Version: 11.0.3.42 Application Timestamp: 51940491 Fault Mo