Have to Display Transfer orders in horizontal format in script outputlayout
Hi,
I had a problem, I have to display Transfer Orders in Horizontal format in Script Out put layout.
For this i need a logic for displaying in horizontal way..
Can you suggest anything ?
Thanks a lot .....
Hi ,
Example think that each Transfer order have different values and this form is displaying all this details in single layout..
If I have different Transfer order in internal table it displaying in form as:
1) Transfer order 3) Transfer order
2) Transfer order 4) Transfer order
But i need the out put as given below..
1) Transfer order 2) Transfer order
3) Transfer order 4) Transfer order
So kindly suggest me....
thanking you..........
Similar Messages
-
T.Code to display Transfer Order with respect to Deliver
Hi all,
Can anybody let me know,what is the transaction code to display Transfer Order Created with respect to delivery.
Thanks in Advance.Hi Joginder,
Thanks for early early.
Do you know the steps to create TO with respect to delivery.?(by any chance)
I a technical consultant. I dont have any idea on this.
I have searched in SDN/Google but couldnt find steps to create TO with delivery.
Thanks -
Oaf requirement:have to display the order number but save the order id
this is a standard practice with d2k forms.i have a requirement where in i have to store the order id in the table but have to display the user with the corresponding order numbr at all times..can any1 please help me with this***urgent***
Hooray! I get to post my daily reply saying the following:
OA Framework is so radically different than just straight Java coding that Oracle has a separate [url http://forums.oracle.com/forums/forum.jspa?forumID=210] forum for OA Framework.
That is the appropriate place for this question. -
Transfer Order Confirmation not updated in Header level (Table: LTAK)
Hi,
We are facing a problem, transfer order header is not updated with confirmation, but TO items are confirmed and resulting these transfer order to display in RF monitor (LRF1 and LRF2 transactions).
And the other issue is, we are seeing some transfer orders created without item data (in LTAP table) and unable to confirm these TOs since Item data is not available, hence TO header is not updated with confirmation and resulting these TOs to display in LRF1 and LRF2 report.
I have cleared some transfer orders by updating the confirmation field in LTAK table through debugging. But we see the issue is ongoing and would like to have permanent solution.
It will be a great help if anyone have solution to these issues.
Thanks & Regards,
NagarjunHi Nagarjun,
do you have any Z code in-between ? Did you check OSS notes ? Did you apply all patches to your system ?
What you are describing is something usual when Z programs were developed, you should provide more details for analysis.
Many thanks,
Enrico -
Automatic/Direct Creation of Transfer OrderS
Hello Gurus,
these are my question:
(1)for Automatic/Direct Creation of Transfer Orders, should it be created when saving delivery order, or do I have to create transfer order after this function ? how to config this function?
thanks very much!Hi,
The concept of Transfer Order comes if the business have warehouse management system.
Once the delivery is created, we need to do picking.
This can be done in two ways
1. Manual Picking
This is done when there is no warehouse management. means in the delivery picking tab, you have a field as Pick Qty. The you have to give the quantity (either less than or equal to delivery qty field), then you can save the delivery. This is called manual picking
2. Automatic Picking
This is done when there is warehouse management is available. Then in the delivery picking tab, pick qty is grayed out. That means you cant enter the pick qty manually. For this you have to create a transfer order.
For this you have two options
1. With in the delivery:
In the delivery it self before saving the delivery, you can click on "subsequent functions" drop down list on the standard menu bar, in that you have option "Create Transfer Order" click on that
Then it will ask whether you want continue to next, say ok, then it will take you to Tranfer Order Creation Screen, Click on Generate TO item, and save it. Now the delivery is created and the Picking is done for that delivery.
2. Using Transaction Code
You can also do the same using transaction code. For this first you have to save the delivery.
Goto T. Code LT03, Then it will ask for
Warehouse Number (mandatory field)
Plant (optional no need to mention)
Delivery Number (mandatory field) and press enter
Then it will take you to Transfer order creating screen, which will be nothing but above mentioned screen. Continue with same process and save it.
Now picking is done for your delivery.
It cant be possible to create a Transfer Order automatically once after delivery is saved.
Hope this is clear.
Reward if helpful.
Thanks
Praveen -
Good Receipt with reference to delivery or stock transfer order
We have a stock transfer order between two plant. Requirement is as under.
Steps - Supplying plant is creating stock transfer order, doing delivery with reference to STO by VL10B.
Receiving plant is doing Good Reference with reference to delivery or STO t code MIGO.
Now the requirement is if A Plant is supplying 100 nos, at the receiving plant it should not allow less then 100 nos. it should give error that qty is not match with delivering qty.
Thanks in advance
Samir BhattHI,
You mean to say that STO quantity must be equal to GR quantity or else system should throw an error
After STO and delivery PGI is done.
Then GR is made with refernce to STO.
Regards
KK -
Display Report output in Matrix format
Hi
I want to display normal report output in somewhat this manner.
I will have one change requrest number and many transport requests will be assigned to that change request number, and to the transport requests many objects will be assigned.
I have to display the output in this format:
Change Request 1 | Tr No.1 | Tr No.2 | Tr No.1 | and so on....
Obj1
Obj2
Obj3
Change Request 1 | Tr No.1 | Tr No.2 | Tr No.1 | and so on....
Obj1
Obj2
Obj3
Like this it should go on.
I have done the coding part, how to display the data in the above format i am not getting any idea, please help me out if you have any ideas.
Thanks & Regards
Haritha.Hi Vijay,
First of all thank you for the response.
I am retrieving the data from different tables and putting all the data in one internal table called i_final. Below is the declaration of that internal table and how i have populated the data to that. I am using control break statements to display the data but the data is coming in the next line.
Please see the final internal table:
1. Declaration:
Data:Begin of i_final occurs 0,
ccsnr like ysts-ccsnr,
trkorr like ysts-trkorr,
obj_name like e071-obj_name,
check_box(1),
status LIKE YSCS-STATUS,
End of i_final.
2. Populating different internal tables data to this table:
loop at i_ccno.
i_final-ccsnr = i_ccno-ccsnr.
i_final-trkorr = i_ccno-trkorr.
read table i_status with key trkorr = i_ccno-trkorr.
if sy-subrc = 0.
i_final-status = i_status-status.
endif.
read table i_obj_name with key trkorr = i_ccno-trkorr.
if sy-subrc = 0.
i_final-obj_name = i_obj_name-obj_name.
endif.
append i_final.
clear i_final.
endloop.
3. Using Control break statements to display the data.
sort i_final by ccsnr.
loop at i_final.
at new ccsnr.
write:/2 i_final-ccsnr.
endat.
write:20 i_final-trkorr.
uline.
endloop.
But the output is coming like this:
CHG0003785 HSDK933109
HSDK933111
HSDK933113
HSDK933143
HSDK933268
But i want the output like this:
CHG0003785 | HSDK933109 | HSDK933111 | HSDK933113
Thanks & Regards
Haritha. -
Stock transfer order between two storage locations in IS Retail
Hi,
I want to have a Stock transfer order between two storage locations in the plant.
I have activated the "Activate Stock Transfer Between Storage Locations", now i can create a STO and have the "Issuing SLoc" tab.
Having that i get an error message "Not possible to determine shipping data for material XXX" Message no. 06280.
I am trying to have the shipping data in customizing for set stock transfer - "Define Shipping Data for Plants", but my site is not listed due to the use of IS Retail. Is there a way to configure it?
Tnx
LiorHola.
Voy a contestar tu pregunta en espanol. Debes crear al centro emisor como deudor en la transaccion WB02 y ampliar a la organizacion de compra.
Posterior, debes crear al centro receptor como acreedor en la transaccion wb02.
Cesar Moreno. Funcional MM Retail. -
Shipping point determination in stock transfer order,
Hi, experts,
I have one problem regarding stock transfer note, In my business scenario, product wise SR no use for excise invoice, So, i had maintain no range as per shipping point wise, But , when i have create stock transfer order, at a time system take default shipping point , as per shipping point determination, But i want to different shipping point in this stock transfer order, but i can not change shipping point in stock transfer order, Can u give me any solution of this problem,
T.code - Use - ME27
Order type - UB
Regards:
HappyFirst create a STO with a Plant as per your Requirement by maintaining the same Plant in the Material.Also maintain the same Plant in determining the Shipping Point Determination.
Otherwise to change the Shipping Point Manually is not a good habit by the Users.
Best Regards,
Ankur -
Assigning a Group to a Transfer Order
Hi,
I have created few Transfer Orders in WM. How Do I assign those TO's into a group?....Does anyone know about this?Hi,
1. SPRO > LE > WM > Interfaces > Shipping > Define Shipping Control - here choose Shipping Control per WH number. Set delayed delivery update, e.g. "1".
2. VL06P (or VL06O > "Picking") > list your deliveries
3. Select your deliveries from which you want to create the group > (menu) Subsequent functions > Group > Create with WM Reference (give the WH number and mark TO for Multiple Deliveries checkbox)
4. (SAP will create the group and give its number on the status bar - still you are in VL06P) Clicking on the "TO for group" button you can start to process the group (LT0S can also be used to process the group)
5. Confirm your TOs
Two step picking differs from this, please check SAP online help for details. (more config is necessary but it's not so difficult)
Regards,
Csaba -
How can i display the MRP controller in transfer order print?
Dear all:
When i print the transfer order(Tcode: LT31) ,i want to display the MRP controller in the output form.
How can i get that ?
I found the user exit MWMD0001 and add the code in the include like this:
select single dispo from marc
where matnr = ltap-matnr
and werks = ltap-werks.
zdispo = marc-dispo.
But caz the "zdispo" could not been brought to the "print form " of the report RLVSDR40 which control the print LT31.So ,i failed.
Anyone advice?The problem is as zdispo is declared in your user exit it doesn't become available. Had it been declared variable in the include of the program for LT31 you would be able to use it directly in the script.
Try doing this instead in your layout set.
/: PERFORM MRP_CONTROLLER IN PROGRAM ZABCXYZ
/: USING <AP-MATNR&
/: USING <AP-WERKS&
/: CHANGING &ZDISPO&
/: ENDPERFORM
in your program ZABCXYZ.
FORM MRP_CONTROLLER tables in_par structure itcsy
out_par structure itcsy.
tables: marc.
data: matnr like marc-matnr.
data: werks like marc-werks.
READ TABLE IN_PAR WITH KEY LTAP-MATNR.
CHECK SY-SUBRC = 0.
MATNR = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY LTAP-WERKS.
CHECK SY-SUBRC = 0.
WERKS = IN_PAR-VALUE.
select single dispo from marc
where matnr = ltap-matnr
and werks = ltap-werks.
IF SY-SUBRC = 0.
READ TABLE OUT_PAR WITH KEY ZDISPO.
CHECK SY-SUBRC = 0.
OUT_PAR-VALUE = MARC-DISPO.
ELSE.
CLEAR OUT_PAR-VALUE.
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
This should work. -
What tables we have to include to display sales order for paricular order
what tables and fields we have to include to display sales order for particular order and paricular customer?
Sales order detials are stored in VBAK ,VBAP tables,
U can have selection screen for customer, and upon entering the customer name, u can extract the data from the above two tables.
Regarding order, is it Purchase order? if so, u cant extract based on perticular order, coz, these orders are not generated in SAP, they come from Customer and can be registered in Sales order for only reference.
Regards,
Sujatha. -
Automatic form generation on creation transfer order for delivery note?
Hi,
I have to create a form that should automatically be generated on the creation of a transfer order for delivery note. How do I trigger this automatic creation of the form? And how can the transfer order number be passed to my print program?
Thx!hi christophe,
To issue the delivery output, go to transaction VL02N.
Then go to EXTRAS-> OUTPUT->HEADER->EDIT
In the Message output screen enter the relevant output type created for the delivery.
Choose the relevant medium of output.
Choose Simple Mail, in this case the field NAST-NACHA will be having a value of 7.
Specify the Partner Function; in this case it is MA -> Mail partner address
Select the Communication Method for the output type maintained.
This will take you to the SAPOFFICE screen.
Enter there the E-Mail Address to which you want to send the delivery document as PDF.
A mail will be sent to the e-mail address of the E-Mail Address specified, with the delivery output form as a PDF attachment.
hope it will help u ..
*& Report ZZ_TEST *
REPORT zz_test .
INCLUDE zz_test_top.
INCLUDE zz_test01.
FORM entry *
--> RETURN_CODE *
--> US_SCREEN *
FORM entry USING return_code us_screen.
CLEAR retcode.
xscreen = us_screen.
PERFORM processing USING us_screen.
CASE retcode.
WHEN 0.
return_code = 0.
WHEN 3.
return_code = 3.
WHEN OTHERS.
return_code = 1.
ENDCASE.
ENDFORM. "entry
*& Include ZZ_TEST_TOP *
TABLES : nast,
tnapr.
TYPES : BEGIN OF t_SOUDNAMEI1.
INCLUDE STRUCTURE SOUDNAMEI1.
TYPES : END OF t_SOUDNAMEI1.
Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
*Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
i_lips LIKE lips OCCURS 0 WITH HEADER LINE,
i_SOUDNAMEI1 TYPE STANDARD TABLE OF t_SOUDNAMEI1.
Work Area declarations
DATA:w_objhead TYPE soli_tab,
wa_control_parameters TYPE ssfctrlop,
wa_output_options TYPE ssfcompop,
w_return TYPE ssfcrescl,
w_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
w_buffer TYPE string,"To convert from 132 to 255
wa_SOUDNAMEI1 TYPE t_SOUDNAMEI1,
Variables declarations
w_form_name TYPE rs38l_fnam,
w_len_in LIKE sood-objlen,
w_len_out LIKE sood-objlen,
w_len_outn TYPE i,
w_lines_txt TYPE i,
w_lines_bin TYPE i,
retcode TYPE sy-subrc,
xscreen TYPE c,
w_spld TYPE usr01-spld,
w_receiver TYPE SOXNA-FULLNAME,
w_OBJ_RECORD TYPE OBJ_RECORD,
w_user type sy-uname,
w_email TYPE ad_smtpadr.
Constants Declaration
CONSTANTS : c_x TYPE c VALUE 'X',
c_atrate(1) TYPE c VALUE '@'.
*& Include ZZ_TEST01 *
FORM PROCESSING *
FORM processing USING proc_screen.
SELECT * FROM lips
INTO TABLE i_lips
WHERE vbeln = nast-objky.
Call Function module to Getfunction Module name Generated by Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = tnapr-sform
IMPORTING
fm_name = w_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
retcode = sy-subrc.
ENDIF.
CLEAR : wa_control_parameters,
wa_output_options.
CASE nast-nacha.
WHEN '1'.
wa_control_parameters-device = 'PRINTER'.
WHEN '7'.
DATA: l_email TYPE ad_smtpadr.
wa_output_options-tdnoprev = c_x.
wa_control_parameters-getotf = c_x.
To get the default output device maintained in the
User profile
SELECT SINGLE spld FROM usr01
INTO w_spld
WHERE bname EQ nast-usnam.
IF sy-subrc EQ 0.
MOVE w_spld TO wa_output_options-tddest .
ENDIF.
wa_output_options-tdnoprev = c_x.
wa_control_parameters-getotf = c_x.
To get the email address maintained for the particular output
CALL FUNCTION 'NAST_GET_MESSAGE_OBJECT_RECV'
EXPORTING
pi_objkey = nast-tdname
IMPORTING
pe_addr = w_receiver
CHANGING
pc_objhandle = w_obj_record
EXCEPTIONS
maildata_not_readable = 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.
IF w_receiver NA c_atrate.
To retrieve the E-Mail Id in case we get the User name from NAST
CLEAR wa_soudnamei1.
REFRESH i_soudnamei1.
MOVE w_receiver TO wa_soudnamei1-fullname.
To get the user name
CALL FUNCTION 'SO_NAME_CONVERT_API1'
EXPORTING
name = wa_soudnamei1
TABLES
names = i_soudnamei1
EXCEPTIONS
user_not_exist = 1
parameter_error = 2
x_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR wa_soudnamei1.
READ TABLE i_soudnamei1 INTO wa_soudnamei1 INDEX 1.
MOVE wa_soudnamei1-sapname TO w_user.
To get the e-mail Id maintained in the user profile
CALL FUNCTION 'FTR_CORR_CHECK_EMAIL_SAP_USER'
EXPORTING
i_user = w_user
IMPORTING
e_email_address = l_email
EXCEPTIONS
mail_address = 1
determination_error = 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.
MOVE l_email TO w_receiver.
ENDIF.
MOVE w_receiver TO w_email.
ENDCASE.
wa_control_parameters-no_dialog = c_x.
wa_control_parameters-langu = nast-spras .
wa_output_options-tdteleland = nast-tland.
wa_output_options-tdtelenum = nast-telfx .
wa_output_options-tdsenddate = nast-erdat .
wa_output_options-tdsendtime = nast-eruhr .
wa_output_options-tddataset = nast-dsnam .
wa_output_options-tdsuffix1 = nast-dsuf1 .
wa_output_options-tdsuffix2 = nast-dsuf2 .
wa_output_options-tdimmed = nast-dimme .
wa_output_options-tddelete = nast-delet .
wa_output_options-tdautority = nast-tdautority.
wa_output_options-tdcovtitle = nast-tdcovtitle .
wa_output_options-tdcover = nast-tdocover .
wa_output_options-tdreceiver = nast-tdreceiver.
wa_output_options-tddivision = nast-tddivision.
wa_output_options-tdcopies = nast-anzal .
wa_output_options-tdnewid = c_x.
wa_output_options-tdarmod = nast-tdarmod.
wa_output_options-tdnoarmch = c_x.
CALL FUNCTION w_form_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = wa_control_parameters
output_options = wa_output_options
user_settings = ' '
IMPORTING
job_output_info = w_return
TABLES
it_lips = i_lips
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF nast-nacha EQ 7 AND sy-subrc EQ 0.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = w_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Convert PDF from 132 to 255.
LOOP AT i_tline.
Replacing space by ~
TRANSLATE i_tline USING ' ~'.
CONCATENATE w_buffer i_tline INTO w_buffer.
ENDLOOP.
Replacing ~ by space
TRANSLATE w_buffer USING '~ '.
DO.
i_record = w_buffer.
Appending 255 characters as a record
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR w_objhead.
Object with PDF.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES w_lines_bin.
Document information.
w_doc_chng-obj_name = 'Smartform'.
w_doc_chng-expiry_dat = sy-datum + 10.
CONCATENATE 'Delivery' 'Note'
INTO w_doc_chng-obj_descr.
*w_doc_chng-obj_descr = 'Smart form output'.
w_doc_chng-sensitivty = 'F'. "Functional object
w_doc_chng-doc_size = w_lines_txt * 255.
Pack to main body as RAW.
Obj. to be transported not in binary form
CLEAR i_objpack-transf_bin.
Start line of object header in transport packet
i_objpack-head_start = 1.
Number of lines of an object header in object packet
i_objpack-head_num = 0.
Start line of object contents in an object packet
i_objpack-body_start = 1.
Number of lines of the object contents in an object packet
i_objpack-body_num = w_lines_txt.
Code for document class
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = w_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Delivery' 'Note' '.pdf'
INTO i_objpack-obj_descr.
i_objpack-doc_size = w_lines_bin * 255.
APPEND i_objpack.
Document information.
CLEAR i_reclist.
e-mail receivers.
i_reclist-receiver = w_email.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'. "Internet address
APPEND i_reclist.
sending mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = w_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. "processing -
How to Output data in vertically from a horizontal format.
Hello
I have some difficulties how to display my data in my output table. I am greatful for
every tips provided. The data in my it_tab is in a horizontal format but I want to
display this data vertically in my output_tab.
My it_tab looks like this:
table: it_tab
id date amnt
011 2007 1200
011 2008 1400
011 2009 6700
011 2010 3500
012 2007 ---
013 2007 3000
013 2008 1300
014 2007 1200
014 2008 ---
014 2009 9000
015 2007 2500
I would like my output_tab should look like this:
table: t_output
id name date amnt date1 amnt1 date2 amnt2 date3 amnt3
011 jx 2007 1200 2008 1400 2009 6700 2010 3500
012 tx --
014 gx 2007 3000 2008 -- 2009 9000 -- ---
015 hx 2007 2500
t_output already has some data init like id and name.
This is what I have done but I don't output all the data as I want.
clear w_output.
loop at t_output into w_output.
clear w_itab.
loop at it_tab into w_itab where id = w_output-id.
case sy-tabix.
WHEN '1'.
w_output-date = w_itab-date.
w_output-amnt = w_itab-amnt.
WHEN '2'.
w_output-date1 = w_itab-date.
w_output-amnt1 = w_itab-amnt.
WHEN '3'.
w_output-date2 = w_itab-date.
w_output-amnt2 = w_itab-amnt.
WHEN '4'.
w_output-date3 = w_itab-date.
w_output-amnt3 = w_itab-amnt.
endcase.
endloop.
modify t_output from w_output.
endloop.
Could some body please tell me how to do this? I think many people in here have come
across this type of problem before.
Thank you all for helping out.
NadinHi, Nadin!
I suggest you to create a dynamic internal table with variable number of columns. You can do as follows:
1. Create basic fieldcatalog for ALV list (or object) output
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING i_structure_name = 'ZYOUR_BASIC_STRUC'
CHANGING ct_fieldcat = lt_fcat.
2. Determine max number of columns (that is, max number of dates for each ID)
SORT it_tab BY id.
LOOP AT it_tab INTO is_tab.
AT NEW id.
ADD 1 TO l_count.
ENDAT.
AT END OF id.
IF l_count > l_max_count.
l_max_count = l_count.
ENDIF.
CLEAR l_count.
ENDAT.
ENDLOOP.
3. Add one entry to fieldcat for each column
DO l_max_count TIMES.
l_index_char = sy-index.
CONCATENATE 'DATE' l_index_char INTO ls_fcat-fieldname.
*... other fieldcat fields, like texts etc.
APPEND ls_fcat TO lt_fcat.
CONCATENATE 'AMNT' l_index_char INTO ls_fcat-fieldname.
*... other fieldcat fields, like texts etc.
APPEND ls_fcat TO lt_fcat.
ENDDO.
4. Create dynamic table from fieldcat using:
DATA: dt_outtab TYPE REF TO data. "IMPORTANT: make this declaration global, otherwise error
FIELD-SYMBOLS: <table> TYPE STANDARD TABLE.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING it_fieldcatalog = lt_fcat
IMPORTING ep_table = dt_outtab.
ASSIGN dt_outtab->* TO <table>.
5. Fill this table. To do this you need special techniques since you have a generic table with no static structure. For example:
FIELD-SYMBOLS: <line> TYPE ANY,
<field> TYPE ANY.
DATA: l_field_inex TYPE i.
LOOP AT it_tab INTO is_tab.
AT NEW id.
APPEND INITIAL LINE TO <table>.
READ TABLE <table> INDEX sy-tfill ASSIGNING <line>.
l_field_index = 3. "you start from 3rd field - #1 is ID, #2 is NAME
ENDAT.
ASSIGN COMPONENT l_field_index OF STRUCUTRE <line> TO <field>.
<field> = is_tab-date.
ADD 1 TO l_field_index.
ASSIGN COMPONENT l_field_index OF STRUCUTRE <line> TO <field>.
<field> = is_tab-amnt.
ADD 1 TO l_field_index.
ENDLOOP.
6. Display your report in alv. You have valid fieldcat and output table which is created dynamically.
CALL METHOD o_alv->set_table_for_first_display
CHANGING it_outtab = <table>
it_fieldcatalog = lt_fcat.
If you don't use ALV object but rather ALV list, it's similar. Just use corresponding functions for ALV creation and list display.
Note that this is not a tested code. Just an idea to help you procede.
<b><REMOVED BY MODERATOR></b>
HTH.
Regards,
Igor
Message was edited by:
Alvaro Tejada Galindo -
Display query columns in horizontal
Hi all
I'm creating a report using sql commands only(no report builder). I'd like to have my columns to be displayed in horizontal followed by its value. So far I've made it, however I can't get them to be displayed well where all the columns are in the same position as well as the results.
HECS:Higher Education Cafetaria Service
Restaurant and Bar
Membership Report
Date:DateVar
Member ID: 11
Member Name:Donald Anatidae Position:Senior Lecturer
Institution Name:UVan Department:Department of Computers
Phone:03-6355-9876 Employment:Tenured
Annual Fee: $225.25 Monthly Fee: $1.88
GST: $22.53 GST: $20.65
Annual Fee|(including GST): $247.Monthly Fee|(including GST): $20.65
-- Declaring variables
COLUMN Date NOPRINT NEW_VALUE DateVar
COLUMN ID NOPRINT NEW_VALUE IDVar
COLUMN Name NOPRINT NEW_VALUE NameVar
COLUMN Department NOPRINT NEW_VALUE DepartVar
COLUMN Phone NOPRINT NEW_VALUE PhoneVar
COLUMN Institution NOPRINT NEW_VALUE InstiVar
COLUMN Position NOPRINT NEW_VALUE PosVar
COLUMN Employment NOPRINT NEW_VALUE EmployVar
COLUMN Annual_Fee NOPRINT NEW_VALUE AnnualVar
COLUMN GST NOPRINT NEW_VALUE AGSTVar
COLUMN Annual_GST NOPRINT NEW_VALUE AnnuaGSTVar
COLUMN M_GST NOPRINT NEW_VALUE MgstVar
COLUMN Month_Fee NOPRINT NEW_VALUE MonthFeeVar
COLUMN Monthy_Gst NOPRINT NEW_VALUE MonthGstVar
BREAK ON ID SKIP Page
TTITLE CENTER 'HECS:Higher Education Cafetaria Service' SKIP 1 -
CENTER 'Restaurant and Bar' SKIP 2 -
LEFT 'Membership Report' SKIP 2 -
LEFT 'Date:'DateVar SKIP 2 -
LEFT COL 6 'Member ID:'IDVar SKIP 1 -
LEFT ------------------------------------------------------------------------------ SKIP 1 -
LEFT COL 6 'Member Name:' NameVar RIGHT 'Position:' PosVar SKIP 1-
LEFT COL 6 'Institution Name:'InstiVar COL 15 RIGHT 'Department:'DepartVar SKIP 1 -
LEFT COL 6 'Phone:'PhoneVar COL 15 RIGHT 'Employment:' EmployVar SKIP 1 -
LEFT COL 6 'Annual Fee:'FORMAT $9,990.99 AnnualVar -
RIGHT 'Monthly Fee:'FORMAT $9,990.99 MonthFeeVar SKIP 1 -
LEFT COL 6 'GST:'FORMAT $9,990.99 AGSTVar -
RIGHT 'GST:'FORMAT $9,990.99 MonthGstVar SKIP 1 -
LEFT ------------------------------------------------------------------------------ SKIP 1 -
LEFT COL 6 'Annual Fee|(including GST):'FORMAT $9,990.99 AnnuaGSTVar -
RIGHT 'Monthly Fee|(including GST):'FORMAT $9,990.99 MonthGstVar SKIP 1 -
LEFT -------------------------------------------------------------------------------
[\pre]
I'd like to know is whether there is another way to display the columns in horizontal.
ThanxHe gave you the general idea. The following takes it a step further.
scott@ORA92> CLEAR COLUMNS
scott@ORA92> TTITLE OFF
scott@ORA92> COLUMN today NEW_VALUE DateVar
scott@ORA92> SELECT SYSDATE AS today FROM DUAL
2 /
TODAY
17-APR-2006
scott@ORA92> TTITLE CENTER 'HECS: Higher Education Cafetaria Service' SKIP 1 -
CENTER 'Restaurant and Bar' SKIP 2scott@ORA92> COLUMN membership_report HEADING 'Membership Report||Date: &DateVar|'
scott@ORA92> SELECT 'Member ID: ' || e.empno
2 || CHR(10)
3 || '-------------------------------------------------------------'
4 || CHR(10)
5 || 'Member Name: ' || RPAD (e.ename, 20) || 'Position: ' || e.job
6 || CHR(10)
7 || 'Institution: ' || RPAD (d.deptno, 20) || 'Department: ' || d.dname
8 || CHR(10)
9 || 'Salary: ' || RPAD (TO_CHAR (e.sal, '$9,990.99'), 20)
10 || 'Commission: ' || TO_CHAR (e.comm, '$9,990.99')
11 || CHR(10)
12 || '-------------------------------------------------------------'
13 || CHR(10)
14 || 'Annual Fee: ' || RPAD (TO_CHAR (e.sal, '$9,990.99'), 20)
15 || 'Monthly Fee: ' || (TO_CHAR (e.sal/12, '$9,990.99'))
16 || CHR(10)
17 || '-------------------------------------------------------------'
18 || CHR(10)
19 || CHR(10)
20 AS membership_report
21 FROM emp e, dept d
22 WHERE e.deptno = d.deptno
23 /
HECS: Higher Education Cafetaria Service
Restaurant and Bar
Membership Report
Date: 17-APR-2006
Member ID: 7369
Member Name: SMITH Position: CLERK
Institution: 20 Department: RESEARCH
Salary: $800.00 Commission:
Annual Fee: $800.00 Monthly Fee: $66.67
Member ID: 7499
Member Name: ALLEN Position: SALESMAN
Institution: 30 Department: SALES
Salary: $1,600.00 Commission: $300.00
Annual Fee: $1,600.00 Monthly Fee: $133.33
Member ID: 7521
Member Name: WARD Position: SALESMAN
Institution: 30 Department: SALES
Salary: $1,250.00 Commission: $500.00
Annual Fee: $1,250.00 Monthly Fee: $104.17
Member ID: 7566
Member Name: JONES Position: MANAGER
Institution: 20 Department: RESEARCH
Salary: $2,975.00 Commission:
Annual Fee: $2,975.00 Monthly Fee: $247.92
Member ID: 7654
Member Name: MARTIN Position: SALESMAN
Institution: 30 Department: SALES
Salary: $1,250.00 Commission: $1,400.00
Annual Fee: $1,250.00 Monthly Fee: $104.17
Member ID: 7698
Member Name: BLAKE Position: MANAGER
Institution: 30 Department: SALES
Salary: $2,850.00 Commission:
Annual Fee: $2,850.00 Monthly Fee: $237.50
Member ID: 7782
Member Name: CLARK Position: MANAGER
Institution: 10 Department: ACCOUNTING
Salary: $2,450.00 Commission:
Annual Fee: $2,450.00 Monthly Fee: $204.17
Member ID: 7788
Member Name: SCOTT Position: ANALYST
Institution: 20 Department: RESEARCH
Salary: $3,000.00 Commission:
Annual Fee: $3,000.00 Monthly Fee: $250.00
Member ID: 7839
Member Name: KING Position: PRESIDENT
Institution: 10 Department: ACCOUNTING
Salary: $5,000.00 Commission:
Annual Fee: $5,000.00 Monthly Fee: $416.67
Member ID: 7844
Member Name: TURNER Position: SALESMAN
Institution: 30 Department: SALES
Salary: $1,500.00 Commission: $0.00
Annual Fee: $1,500.00 Monthly Fee: $125.00
Member ID: 7876
Member Name: ADAMS Position: CLERK
Institution: 20 Department: RESEARCH
Salary: $1,100.00 Commission:
Annual Fee: $1,100.00 Monthly Fee: $91.67
Member ID: 7900
Member Name: JAMES Position: CLERK
Institution: 30 Department: SALES
Salary: $950.00 Commission:
Annual Fee: $950.00 Monthly Fee: $79.17
Member ID: 7902
Member Name: FORD Position: ANALYST
Institution: 20 Department: RESEARCH
Salary: $3,000.00 Commission:
Annual Fee: $3,000.00 Monthly Fee: $250.00
Member ID: 7934
Member Name: MILLER Position: CLERK
Institution: 10 Department: ACCOUNTING
Salary: $1,300.00 Commission:
Annual Fee: $1,300.00 Monthly Fee: $108.33
14 rows selected.null
Maybe you are looking for
-
11g, reusing a popup window
Hello, I have a "search customer" dialog (and some others) which will be used throughout the application, and I would like to encapsulate it so other screens can easily use it. I am not really sure how should I do this: - Use a page fragment: since i
-
Informix Drivers do not appear to work with some components
I am attempting to connect via JDBC to an informix 7.3 dynamic server. I downloaded the most current IBM/Informix drivers Informix JDBC Driver 2.21.JC5 and created another server type (informix) with the appropriate driver class and url template: I c
-
Why won't my Clickfree work - Help
I recently purchased a CLICKFREE HD1037nse BACKUP EXTERNAL HDD and each time i plug it in it does nothing except it attempt to do a software update> reboots> then asks for another software update and just repeats. any suggestions or tips on how i can
-
RC-00110: Fatal: Error occurred while relinking of ApplyDBTechStack
Hi Experts, I am performing Cloning for Oracle Application R12 with rapid clone and adcfgclone dbTier is failing with the below error. RC-00110: Fatal: Error occurred while relinking of ApplyDBTechStack Both my source and target system are on the sam
-
hello In MMSC enter storage location collectivily list like SL01 and SL02 but i maintaind MRP indication 1 for SL01 now I want delete the the MRP indicatior '1' for SL01 it is not possible for me, if any body nows pls guide me how to deleta M