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 Saxena
Yes 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..
Similar Messages
-
Want to pass STRS2 field into sales order and contract.
Hi Friends.
I am creating Sales order using function module IDOC_INPUT_ORDERS and Contract using SD_SALESDOCUMENT_CREATE.
Now I want to pass STRS2(House number field into Sales Order/Contract). In IDOC I tried to pass E1EDKA1-STRS2, but its not coming into Sales order output.But SD_SALESDOCUMENT_CREATE dont have an option to pass the field value.
So in that case how can I achieve the desired functionality, Is there any user exit or let me know the suitable method to achieve the functionality.
Thanks
GowrishankarYes I tried that also.I passed the value from program to user exit MV45AFZZ and updated the structure XVBADR in USEREXIT_SAVE_DOCUMENT_PREPARE, but its not getting reflected in Sales Order/Contract.
Anyone have suggestion..plz let me know.
Thanks
Gowrishankar -
How to pass the field value from module pool program to smartform using submit?
// AT pai of module pool pgm i entered the following: here gv_orderid is my value to be available at smart form(driver pgm) & zmusic_store_smf is the driver program of my smartform.
gv_orderid= wa-itemid./
SUBMIT ZMUSIC_STORE_SMF VIA SELECTION-SCREEN
WITH p_order = gv_orderid
AND RETURN.
//AT driver pgm(zmusic_store_smf):
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZMUSIC_SMARTFORM1'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = lv_form
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION lv_form
EXPORTING
* iv_orderid = is_purchase_item-zorder_id.
iv_orderid = gv_orderid.
// here i'm trying to call my smartform('ZMUSIC_SMARTFORM1') from this driver pgm but unable to access the value of gv_orderid please help me out with this.Declare the gv_orderid in modulepool program.
And Declare the parameter as import parameter in smartform.
CALL FUNCTION lv_form
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
i_input = gv_orderid
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* USER_CANCELED = 4
* OTHERS = 5 -
Problem with the quantity field in bdc?
Hi,
i have to populate a quantity field in bdc .
for ex 123.00. but the bdc accepting only in the form of 123,00.
How can I do this .
I tried by changing the user profile, but went in vain.
Suggest me how to convert ?
Thanks.Hi,
Create a variable of TYPE CHAR.Write your quantity field value into this variable and pass this variable to the BDC. This is the way of passing quantity fields to BDC.
DATA: V_AMOUNT(22) TYPE C.
WRITE ITAB-DMBTR INTO V_AMOUNT.
Pass this V_AMOUNT to BDC flow.
Hope this helps.
ashish -
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 -
String Conversion into Quantity field ----------Sales Orders
Hi Experts,
Can any of you give an standard function module or conversion routine for String conversion to Quantity field.
The problem is I pass on 5 value as a string and while the system creates any sales orders, now in the quantity filed
it shows me as 0.005 and for value 7 it gives me as 0.007.
So, Now I want a conversion in such a way that if I pass 5 then the system should 5.000 and if I pass 10 it should show
as 10.00 likewise for 100 or above also.
Thank you,
KishoreJ.Hi,
You have check , what is user format configure in each user then reply the forum.
Thanks
With Regards
I.Muthukumar -
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 -
URGENT : how to pass status & reason field in BAPI_LEAD_CREATEMULTI module
HI,
<b>CAN ANYONE TELL ME how to pass status & reason field in BAPI_LEAD_CREATEMULTI module.IT'S VERY URGENT,</b>
SO PLEASE SEND ME YOUR REPLY AS EARLY AS POSSIBLE,
TAHNKS IN ADVANCEDHi ,
your config is missing , what is ur TD object ?
you can cross check in SE75-->Under MARA
regards
Prabhu -
How can create a function module for currency and quantity fields
hi,
i want to create a function module with some fields.when i activated it give some errors for
netpr,menge,wemng fields(currency, quantity fields).error is it asks for reference fields.
please send me solution for it.
sreenu.Hi Sreenu,
While creating CURRENCY/QUANTITY fields in the DataBase Table, you have to enter a REFERENCE TABLE and a REFERENCE FIELD to the field.
For that, after entering the field name and the data type in the correcponding columns, you have to place the cursor on the data type of the required field and click the CURRENCY/QUANTITY FIELDS tab. You will find two columns called REFERENCE TABLE and a REFERENCE FIELD.
you have to enter a reference table in which a currency/quantity field is used and a reference field which is a currency/quantity field in that table.
For Example, below is the table details.
FIELD DATATYPE LENGTH DEC.PLACES REF.TABLE REF.FIELD
1.SNO CHAR 5
2.AMOUNT CURR 10 2 T001 WAERS
3.NOS QUAN 5 KNA1 /VSO/R_PAL_UL
Here Field 2(AMOUNT) is a CURR field whose Ref. Table is T001 and Ref. Field is WAERS and Field 3(NOS) is a QUAN field whose Ref. Table is KNA1 and Ref. Field is /VSO/R_PAL_UL.
Hope this will help you.
Regards,
Vaitheeswaran -
How to pass variable value into module pool scren from a report program
Hi,
I have created a report program with selection screen parameters. when the inputs are filled and executed it generates the purchase evaluation sequence number. i have created a screen and passed that number to display on it with print option and back option buttons as required. but variable alone is not getting passed from the program to module pool screen. buttons are working fine. value alone is not coming. can anyone please help me.
regards,
sudha.Hi ,
you need to declare that variable param at Global.
sample code...
report xyz....
data: g_no type ekko-ebeln.
start-of-selection...
g_no = '12345'.
call screen 0100. -
How to make quantity field in puplic templates editable?
Hi SDN,
we are implementing SRM 5.0.
We have a change request to make the quantity field in public templates (or when you chose approved (old) shopping carts for a new order) ready for input.
What I tried so far is to go to the corresponding template, which is
SAPLBBP_PDH_SEARCH 4001 and exchange
`SUBLIST-QUANTITY[n].value`
by
<input type="text" name="SUBLIST-QUANTITY[n]" value="`SUBLIST-QUANTITY[n].value`">
Debugging the corresponding dynpro 4001 of function group BBP_PDH_SEARCH
PAI: MODULE mark_read_from_web.
there:
LOOP AT <sublist> INTO <lfs_sub_wa>.
shows, that the new quantity I might set on the webfrontend does not get transferred to <sublist>-quantity in the dynpro.
Even though in the debugger I manually changed the incoming quantity, it does not show up on the next webscreen with the shopping cart...
any ideas welcome,
regards, matthiasHi Atul,
the need for the requirement is very obvious, also we had this modification in the old release - and I am merely trying to rebuild it.
But for the business case: Just imagine you have 100 or more articles in a public template and maybe you have to chose new articles from different public templates. Then it is really painful if you have to recheck the shopping cart after you have filled it, just to change the quantities. This modification saves a lot of time and work for the users. Also I am wondering why it is not already standard behaviour.
regards, matthias -
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 -
Problem with quantity field in BDC
hi experts,
i am trying to upload data from internal table to SAP using BDC, but while uploading quantity fields it is giving error as "Input fields is longer than screen field", Is there any method to upload quantity fields to SAP.
thanks in adancae,Hi,
Before passing the value to perform bdc_field, convert that value to char type
For eg.
DATA : v_val(10) TYPE c,
v_val = wa_operation-std_value_01. CONDENSE v_val.
CONCATENATE 'PLPOD-VGW01(' n_linecount1 ')' INTO v_para.
PERFORM f_bdc_field USING v_para v_val.
FORM f_bdc_field USING fnam fval.
CLEAR wa_bdctab.
wa_bdctab-fnam = fnam.
wa_bdctab-fval = fval.
APPEND wa_bdctab TO it_bdctab.
ENDFORM. " f_bdc_field
check this it would be useful. -
How to pass enhanced fields in BAPI_PO_CREATE
Dear Memebers,
I have a requirement to pass the Enhanced fileds in Module Function BAPI_PI_CREATE using VB.NET can anyone send me sample.
Thanks,
NasirDear Nasir,
In order to pass enhanced fields to the BAPI_PO_CREATE function module, populate a table of type BAPIPAREX and pass it to the EXTENSIONIN tables parameter of the FM.
(Sample Code): Suppose you enhanced Purchasing Document Item Table EKPO with Append structure ZEKPO with the fields ZNAME1 and ZDATA1.
DATA: GT_EXTENSION TYPE TABLE OF BAPIPAREX,
WA_EXTENSION TYPE BAPIPAREX.
CLEAR WA_EXTENSION.
WA_EXTENSION-STRUCTURE = 'ZEKPO'. " 'Name of the Append Structure for Standard PO header/item table'
CONCATENATE WA_EKPO-ZNAME1 WA_EKPO-ZDATA1 INTO WA_EXTENSION-VALUEPART1. (Ensure that the total character length of these fields is less than 240)
APPEND WA_EXTENSION TO GT_EXTENSION.
Similarly, you need to pass the ZEKPOX structure with the relevant check boxes. For this, you need to refer to the documentation for Function Module but generally, Passing Enhanced Fields work this way.
Regards,
Amit Sharma -
Hi All,
How can i handle the Quantity field using BAPIPAREX?
EX.
I have added the following custom fields to the standard table EKKO.
zf_base (Price per ton, CURRENCY)
zreq_tons (Tons Required,QUANTITY)
zpo_issue_date (PO Issue date,Date)
Here I am using the bapi 'BAPI_PO_CREATE1' to create Purchase Order. How can i pass the above fields to BAPI.U dont have to create a Z verion. u can use extensionIN parameter. take a look at the bapi funtion module documentation. here is the hint,
<b>Customer's Own Fields (Import Parameters)</b>
This table allows you to add to the import parameters of the BAPI without modifying it.
The customer enhancement SAPL2012 allows you to add to or modify the PurchaseOrder.Change and PurchaseOrder.CreateFromData1BAPIs by:
Adapting existing SAP database tables
o Adding customer-specific fields to SAP tables
o Including existing database fields
Including additional customer-specific database tables
The following BAPI Table Extensions are available:
BAPI_TE_MEPOHEADER
BAPI_TE_MEPOHEADERX
BAPI_TE_MEPOITEM
BAPI_TE_MEPOITEMX
BAPI_TE_MEPOACCOUNTING
BAPI_TE_MEPOACCOUNTINGX
Maybe you are looking for
-
BODS 3.1 :SMTP configuration to send email for success or failure of job
Hi. This is further to this post : http://forums.sdn.sap.com/thread.jspa?threadID=1965129&tstart=0 Thanks to all for the help. I did not find a complete set of information as things to do (for a person who is new to BODS). Hence sharing the workflow
-
I have downloaded songs from my home computer to my ipod, but now I am on holidays and have bought some songs from itunes store, downloaded onto my laptop, but when I try to add them to my ipod I get a message that I can only use one music library, a
-
Symbol font is not displaying correctly on mozilla 23.0.1?
I am displaying a html page inside a frame having some Maths symbols, using SYMBOL font. but these symbols are not display correct on mozilla browser. provide some solution.
-
guys help me... i just found out and noticed just today that my photo gallery is somewhat blurry... when i'm trying to browse the photos it's pixelated eventhough the pictures are alright and clear before... before when i'm scrolling the photos it's
-
De-authorization of all computers
I am having issues with de-authorization of my 5 computers. Every time when I tried to do that, it gives me an error stating that I have to wait until Dec. 20, 2010 in order to do that. Does anyone know how I can do this today instead of waiting unti