Print out of Organisational Structure
Hi SAP Pulies,
How i can take print out of "organisational structure" from Organisational Management ??
Hi,
You can use PPOS_OLD for display of your structure click Structural graphics view and give print.
Regards
Chandrashekar
Similar Messages
-
Print out spry menu structure?
Is there a way to print out the complete Spry Menu Bar
structure that someone builds in dreamweaver so it would show how
each menu listing branches off?Hi,
You can use PPOS_OLD for display of your structure click Structural graphics view and give print.
Regards
Chandrashekar -
Dear All.
Till this day the duty-form for a company were performed through a
special Form Program, it is performed via processing routines.
The first Form Routine's name is entry.
Form was printed-out for each Transport up to now.
Current Requirements are for next time as follows:
Printing out one form for every delivery (shipment) instead of
for each Transport as so far. Please notice one Transport may
consist of many deliveries (Shipment). 1 Transport : n Shipment.
DATA:
lc_wa_usrdata TYPE /Z2a/ty_lw_usrdata.
INCLUDE rvadtabl.
SET EXTENDED CHECK OFF.
TABLES: vbpla, thead, ttxer, ttxit, t005, vbddl, stxh, sadr."SADR40A
INCLUDE vttkdata. "Shipment Header
INCLUDE vttsdata. "Shipment Segment
INCLUDE vttpdata. "Shipment Items
INCLUDE vbpadata. "Partner
INCLUDE vtfadata. "Flow
INCLUDE sadrdata. "Address
INCLUDE vtlfdata. "Delivery Selection
INCLUDE vsedata. "shipping units
INCLUDE rv56acom. "I/O-Structure
SET EXTENDED CHECK ON.
TABLES: /Z2a/tv_schein.
FORM entry USING return_code us_screen.
DATA: lf_retcode TYPE sy-subrc.
screen = us_screen.
PERFORM processing USING us_screen
CHANGING lf_retcode.
IF lf_retcode NE 0.
return_code = 1.
ELSE.
return_code = 0.
ENDIF.
ENDFORM.
FORM processing USING proc_screen
CHANGING cf_retcode.
DATA: ls_print_data_to_read TYPE ledlv_print_data_to_read.
DATA: ls_dlv_delnote TYPE ledlv_delnote.
DATA: lf_fm_name TYPE rs38l_fnam.
DATA: ls_control_param TYPE ssfctrlop.
DATA: ls_composer_param TYPE ssfcompop.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: lf_formname TYPE tdsfname.
DATA: ls_addr_key LIKE addr_key.
DATA: ls_header LIKE /Z2a/ss_pv_kopf.
DATA: tb_daten LIKE /Z2a/ss_pv_daten OCCURS 1.
DATA: lc_va_lfnr TYPE nrlevel.
DATA: lc_va_year TYPE char4.
DATA: lc_va_keyseg_pv TYPE /dca/p000_keyseg.
DATA: lc_tb_bwdat_pv TYPE /dca/p000_ty_tb_bwdat.
DATA: lc_wa_bwdat_pv TYPE /dca/p000_ty_wa_bwdat.
DATA: lc_wa_bwm_res_pv TYPE /Z2a/dat_cu_pvschein.
DATA: lc_va_lifnr TYPE kunnr.
DATA: lc_va_nr TYPE nrnr.
DATA: lc_va_anz TYPE /Z2a/anz_pv.
DATA: lc_va_no TYPE /Z2a/anz_kein_pv.
DATA: lc_wa_pvschein LIKE /Z2a/tv_schein.
DATA: lc_va_line LIKE sy-tabix.
DATA: lc_va_flag_zoll TYPE segal,
lc_va_rqident TYPE rspoid,
lc_va_vsart TYPE vsarttr,
lc_va_tknum TYPE tknum.
DATA: lc_va_obj TYPE nrobj.
DATA: lc_va_printer TYPE rspopname.
DATA: lc_va_pv_kz TYPE char4.
DATA: lc_va_tplst TYPE tplst.
* SmartForm from customizing table TNAPR
lf_formname = tnapr-sform.
* determine print data
PERFORM set_print_data_to_read USING lf_formname
CHANGING ls_print_data_to_read
cf_retcode.
IF cf_retcode = 0.
* select print data
PERFORM get_data_pv TABLES tb_daten
CHANGING ls_header
lc_va_flag_zoll
lc_va_vsart
lc_va_tplst
cf_retcode.
ENDIF.
lc_va_tknum = nast-objky.
IF cf_retcode = 0.
ELSE.
PERFORM protocol_nast_update.
cf_retcode = 4.
EXIT.
ENDIF.
IF cf_retcode = 0.
* determine smartform function module for delivery note
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = lf_formname
IMPORTING fm_name = lf_fm_name
EXCEPTIONS no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
DESCRIBE TABLE tb_daten LINES lc_va_line.
IF lc_va_line <> 0.
lc_va_pv_kz = 'JA'.
SELECT SINGLE lifnr
FROM vtpa
INTO lc_va_lifnr
WHERE vbeln = nast-objky
AND parvw = 'YL'.
lc_va_keyseg_pv = ls_header-kunnr.
lc_va_keyseg_pv+10(10) = lc_va_lifnr.
lc_va_keyseg_pv+20(2) = lc_va_vsart.
lc_va_keyseg_pv+22(4) = lc_va_pv_kz.
CALL FUNCTION '/ZTR/P000_MCDATA_FROM_'
EXPORTING
cv_va_keytyp = '/Z2a/KEY_CU_PVSCHEIN'
cv_va_keyseg = lc_va_keyseg_pv
TABLES
cr_tb_bwdat = lc_tb_bwdat_pv.
IF lc_tb_bwdat_pv[] IS INITIAL.
cf_retcode = 4.
ELSE.
LOOP AT lc_tb_bwdat_pv INTO lc_wa_bwdat_pv.
lc_wa_bwm_res_pv = lc_wa_bwdat_pv-datseg.
lc_va_obj = lc_wa_bwm_res_pv(10).
lc_va_nr = lc_wa_bwm_res_pv+10(2).
lc_va_anz = lc_wa_bwm_res_pv+12(8).
lc_va_printer = lc_wa_bwm_res_pv+20(4).
SELECT SINGLE pvno
FROM /Z2a/tv_schein
INTO lc_va_lfnr
WHERE tknum = nast-objky.
IF sy-subrc = 0.
ELSE.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = lc_va_nr
object = lc_va_obj
IMPORTING
number = lc_va_lfnr
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
* call smartform delivery note
ls_composer_param-tddest = lc_va_printer.
* ls_control_param-device = lc_va_printer.
lc_va_year = sy-datum(4).
PERFORM set_print_param USING ls_addr_key
lc_va_lfnr
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
cf_retcode.
lc_wa_usrdata-mandt = sy-mandt.
lc_wa_usrdata-udate = sy-datum.
lc_wa_usrdata-uzeit = sy-uzeit.
lc_wa_usrdata-usr = sy-uname.
lc_wa_usrdata-sysid = sy-sysid.
DO lc_va_anz TIMES.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = ' '
ls_header = ls_header
lc_va_lfnr = lc_va_lfnr
lc_va_year = lc_va_year
lc_va_tplst = lc_va_tplst
lc_wa_usrdata = lc_wa_usrdata
TABLES
tb_daten = tb_daten
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
ENDDO.
ELSE.
lc_va_pv_kz = 'NEIN'.
SELECT SINGLE lifnr
FROM vtpa
INTO lc_va_lifnr
WHERE vbeln = nast-objky
AND parvw = 'YL'.
lc_va_keyseg_pv = ls_header-kunnr.
lc_va_keyseg_pv+10(10) = lc_va_lifnr.
lc_va_keyseg_pv+20(2) = lc_va_vsart.
lc_va_keyseg_pv+22(4) = lc_va_pv_kz.
CALL FUNCTION '/ZTR/P000_MCDATA_FROM_'
EXPORTING
cv_va_keytyp = '/Z2a/KEY_CU_PVSCHEIN'
cv_va_keyseg = lc_va_keyseg_pv
TABLES
cr_tb_bwdat = lc_tb_bwdat_pv.
IF lc_tb_bwdat_pv[] IS INITIAL.
cf_retcode = 4.
ELSE.
LOOP AT lc_tb_bwdat_pv INTO lc_wa_bwdat_pv.
lc_wa_bwm_res_pv = lc_wa_bwdat_pv-datseg.
lc_va_obj = lc_wa_bwm_res_pv(10).
lc_va_nr = lc_wa_bwm_res_pv+10(2).
lc_va_anz = lc_wa_bwm_res_pv+12(8).
lc_va_printer = lc_wa_bwm_res_pv+20(4).
SELECT SINGLE pvno
FROM /Z2a/tv_schein
INTO lc_va_lfnr
WHERE tknum = nast-objky.
IF sy-subrc = 0.
UPDATE /Z2a/tv_schein
SET flag_pv = ' '
WHERE tknum = nast-objky.
ELSE.
* laufende nummer füllen, bei keinen PV-Teilen Nummernkreis 99
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = lc_va_nr
object = lc_va_obj
* QUANTITY = '1'
* SUBOBJECT = ' '
* TOYEAR = '0000'
* IGNORE_BUFFER = ' '
IMPORTING
number = lc_va_lfnr
* QUANTITY =
* RETURNCODE =
* EXCEPTIONS
* INTERVAL_NOT_FOUND = 1
* NUMBER_RANGE_NOT_INTERN = 2
* OBJECT_NOT_FOUND = 3
* QUANTITY_IS_0 = 4
* QUANTITY_IS_NOT_1 = 5
* INTERVAL_OVERFLOW = 6
* BUFFER_OVERFLOW = 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.
ENDLOOP.
lc_va_year = sy-datum(4).
ls_composer_param-tddest = lc_va_printer.
PERFORM set_print_param USING ls_addr_key
lc_va_lfnr
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
cf_retcode.
lc_wa_usrdata-mandt = sy-mandt.
lc_wa_usrdata-udate = sy-datum.
lc_wa_usrdata-uzeit = sy-uzeit.
lc_wa_usrdata-usr = sy-uname.
lc_wa_usrdata-sysid = sy-sysid.
DO lc_va_anz TIMES.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = ' '
ls_header = ls_header
lc_va_lfnr = lc_va_lfnr
lc_va_year = lc_va_year
lc_va_tplst = lc_va_tplst
lc_wa_usrdata = lc_wa_usrdata
TABLES
tb_daten = tb_daten
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
ENDDO.
ENDIF.
ENDIF.
SELECT SINGLE *
FROM /Z2a/tv_schein
INTO lc_wa_pvschein
WHERE tknum = nast-objky.
IF sy-subrc = 0.
ELSE.
IF NOT lc_va_lfnr IS INITIAL.
lc_wa_pvschein-mandt = sy-mandt.
lc_wa_pvschein-tknum = nast-objky.
INSERT INTO /Z2a/tv_schein
VALUES lc_wa_pvschein.
UPDATE /Z2a/tv_schein SET
pvno = lc_va_lfnr
vsart = lc_va_vsart
exti1 = ls_header-schiffname
signi = ls_header-siegel
flag_zoll = lc_va_flag_zoll
exti2 = ls_header-contnr
lifex = ls_header-mbcnr
dalen = ls_header-dalen
dptbg = ls_header-dptbg
kunnr = ls_header-kunnr
add03 = ls_header-add03
parnr = lc_va_lifnr
datum_druck = sy-datum
uzeit_druck = sy-uzeit
ernam_druck = sy-ucomm
WHERE tknum = nast-objky.
IF tb_daten IS INITIAL.
UPDATE /Z2a/tv_schein SET
flag_pv = ' '
WHERE tknum = nast-objky.
ELSE.
UPDATE /Z2a/tv_schein SET
flag_pv = 'X'.
ENDIF.
ENDIF.
ENDIF.
* get SmartForm protocoll and store it in the NAST protocoll
* PERFORM ADD_SMFRM_PROT. DEL_HP_335958
ENDFORM.
FORM get_data_pv TABLES lc_tb_daten
CHANGING cs_header TYPE /Z2a/ss_pv_kopf
lc_va_flag_zoll TYPE segal
lc_va_vsart TYPE vsarttr
lc_va_tplst TYPE tplst
cf_retcode.
TYPES: BEGIN OF ty_wa_vbeln,
vbeln TYPE vbeln_vl,
END OF ty_wa_vbeln,
ty_tb_vbeln TYPE STANDARD TABLE OF ty_wa_vbeln
WITH DEFAULT KEY
INITIAL SIZE 0,
ty_wa_lips LIKE lips,
ty_tb_lips TYPE STANDARD TABLE OF ty_wa_lips
WITH DEFAULT KEY
INITIAL SIZE 0.
DATA: lc_tb_cond LIKE /Z2a/ss_pv_daten OCCURS 1.
DATA: lc_wa_daten TYPE /Z2a/ss_pv_daten.
DATA: lc_wa_cond TYPE /Z2a/ss_pv_daten.
DATA: lc_va_tknum TYPE tknum,
lc_tb_lips TYPE ty_tb_lips,
lc_wa_lips TYPE ty_wa_lips,
lc_va_kunnr TYPE kunnr,
lc_va_pvvkz TYPE /Z2a/pvvkz,
lc_va_exprf TYPE exprf,
lc_va_matnr TYPE matnr,
lc_va_menge TYPE lfimg.
DATA: lc_tb_vbeln TYPE ty_tb_vbeln,
lc_wa_vbeln TYPE ty_wa_vbeln,
lc_va_land1 TYPE land1,
lc_va_lifnr TYPE lifnr.
DATA: lc_va_exnum TYPE exnum.
DATA: lc_va_keyseg TYPE /dca/p000_keyseg.
DATA: lc_tb_bwdat TYPE /dca/p000_ty_tb_bwdat.
DATA: lc_wa_bwdat TYPE /dca/p000_ty_wa_bwdat.
DATA: lc_wa_bwm_result TYPE /Z2a/dat_cu_pvabwicklung.
DATA language LIKE nast-spras.
DATA shipment_number LIKE vttk-tknum.
CLEAR cf_retcode.
* get data
language = nast-spras.
shipment_number = nast-objky.
CALL FUNCTION 'RV_SHIPMENT_PRINT_VIEW'
EXPORTING
shipment_number = shipment_number
option_tvtk = 'X' "Shipmenttype J/N
option_ttds = 'X' "Disposition J/N
language = language
option_items = 'X' "Transport Items J/N
option_segments = 'X' "Transport Segments J/N
option_partners = 'X' "Partners J/N
option_sales_orders = 'X' "Sales orders J/N
option_export_data = 'X' "Export data J/N
option_packages = 'X' "Packages J/N
option_flow = ' ' "Flow J/N
option_no_refresh = ' ' "Refresh Tables J/N
IMPORTING
f_vttkvb = vttkvb "Shipment Header
f_tvtk = tvtk "Shipmenttype
f_tvtkt = tvtkt "Description Shipmenttype
f_ttds = ttds "Disposition
f_ttdst = ttdst "Description Disposition
f_vbpla = vbpla "Packages
TABLES
f_vttp = xvttp "Shipment Items
f_trlk = slk "Delivery
f_trlp = slp "Delivery Item
f_vtts = xvtts "Shipment Segments
f_vtsp = xvtsp "Segments/Items
f_vbpa = xvbpa "Partner
f_vbadr = xvbadr "Address
f_vtfa = xvtfa "Flow
f_vbplk = xvbplk "Shipment Unit Header
f_vbplp = xvbplp "Shipment Unit
f_vbpls = xvbpls "Shipment Unit Sum
EXCEPTIONS
not_found = 1.
cs_header-tknum = nast-objky.
cs_header-schiffname = vttkvb-exti1.
cs_header-abfahrt = vttkvb-dptbg.
cs_header-contnr = vttkvb-exti2.
cs_header-normt = vttkvb-add01.
cs_header-siegel = vttkvb-signi.
cs_header-gewbr = vttkvb-text2.
cs_header-gewnt = vttkvb-text3.
cs_header-dalen = vttkvb-dalen.
cs_header-dptbg = vttkvb-dptbg.
cs_header-add03 = vttkvb-add03.
lc_va_tplst = vttkvb-tplst.
lc_va_vsart = vttkvb-vsart.
SELECT vbeln
FROM vttp
INTO TABLE lc_tb_vbeln
WHERE tknum = lc_va_tknum.
LOOP AT lc_tb_vbeln INTO lc_wa_vbeln.
SELECT SINGLE kunnr lifex
FROM likp
INTO (lc_va_kunnr, cs_header-mbcnr)
WHERE vbeln = lc_wa_vbeln-vbeln.
SELECT *
FROM lips
INTO TABLE lc_tb_lips
WHERE vbeln = lc_wa_vbeln-vbeln.
ENDLOOP.
LOOP AT lc_tb_lips INTO lc_wa_lips.
SELECT SINGLE pvvkz
FROM /Z2a/ldm_kun
INTO lc_va_pvvkz
WHERE kunnr = lc_va_kunnr.
IF lc_va_pvvkz NE 'X'.
cf_retcode = 4.
EXIT.
ELSE.
SELECT SINGLE exnum segal
FROM eikp
INTO (lc_va_exnum, lc_va_flag_zoll)
WHERE refnr = lc_wa_lips-vbeln.
SELECT SINGLE exprf
FROM eipo
INTO lc_va_exprf
WHERE exnum = lc_va_exnum
AND expos = lc_wa_lips-posnr.
lc_va_keyseg = lc_va_exprf.
CALL FUNCTION '/ZTR/P000_MCDATA_FROM_'
EXPORTING
cv_va_keytyp = '/Z2a/KEY_CU_PVABWICKLUNG'
cv_va_keyseg = lc_va_keyseg
TABLES
cr_tb_bwdat = lc_tb_bwdat.
IF NOT lc_tb_bwdat[] IS INITIAL.
LOOP AT lc_tb_bwdat INTO lc_wa_bwdat.
lc_wa_bwm_result = lc_wa_bwdat-datseg.
IF lc_wa_bwm_result-pv_relevant = 'X'.
* Kumulieren
lc_wa_cond-matnr = lc_wa_lips-matnr.
SELECT SINGLE maktx
FROM makt
INTO lc_wa_cond-arktx
WHERE matnr = lc_wa_lips-matnr
AND spras = 'DE'.
lc_wa_cond-menge = lc_wa_lips-lfimg.
lc_wa_cond-me = lc_wa_lips-meins.
COLLECT lc_wa_cond INTO lc_tb_cond.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
cs_header-kunnr = lc_va_kunnr.
SELECT SINGLE name1 name2 land1
INTO (cs_header-name1,
cs_header-name2,
lc_va_land1)
FROM kna1
WHERE kunnr = lc_va_kunnr.
SELECT SINGLE landx
INTO cs_header-land
FROM t005t
WHERE spras = sy-langu
AND land1 = lc_va_land1.
* Sortieren Aufsteigend nach Materialnr
SORT lc_tb_cond ASCENDING BY matnr.
* Übergabe an Ausgabetabelle
LOOP AT lc_tb_cond INTO lc_wa_cond.
MOVE-CORRESPONDING lc_wa_cond TO lc_wa_daten.
APPEND lc_wa_daten TO lc_tb_daten.
ENDLOOP.
ENDFORM. " get_data_spat
FORM set_print_data_to_read
USING if_formname LIKE tnapr-sform
CHANGING cs_print_data_to_read TYPE ledlv_print_data_to_read
cf_retcode.
FIELD-SYMBOLS: <fs_print_data_to_read> TYPE xfeld.
DATA: lt_fieldlist TYPE tsffields.
DATA: ls_fieldlist TYPE LINE OF tsffields.
DATA: lf_field1 TYPE LINE OF tsffields.
DATA: lf_field2 TYPE LINE OF tsffields.
DATA: lf_field3 TYPE LINE OF tsffields.
CALL FUNCTION 'SSF_FIELD_LIST'
EXPORTING
formname = if_formname
* VARIANT = ' '
IMPORTING
fieldlist = lt_fieldlist
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
cf_retcode = sy-subrc.
CLEAR lt_fieldlist.
ELSE.
* set print data requirements
LOOP AT lt_fieldlist INTO ls_fieldlist.
SPLIT ls_fieldlist AT '-' INTO lf_field1 lf_field2 lf_field3.
* <<<< START_OF_INSERTION_HP_350342 >>>>
IF lf_field1 = 'IS_DLV_DELNOTE' AND lf_field2 = 'IT_SERNR'.
lf_field2 = 'IT_SERNO'.
ENDIF.
* <<<< END_OF_INSERTION_HP_350342 >>>>
ASSIGN COMPONENT lf_field2 OF STRUCTURE
cs_print_data_to_read TO <fs_print_data_to_read>.
IF sy-subrc = 0.
<fs_print_data_to_read> = 'X'.
ENDIF.
ENDLOOP.
* header data is always required
cs_print_data_to_read-hd_gen = 'X'.
* adress is always required for print param
cs_print_data_to_read-hd_adr = 'X'.
* organisational data is always required for include texts
cs_print_data_to_read-hd_org = 'X'.
ENDIF.
ENDFORM. " set_print_data_to_read
*& Form set_print_param
* text
* -->P_LS_ADDR_KEY text
* <--P_LS_CONTROL_PARAM text
* <--P_LS_COMPOSER_PARAM text
* <--P_LS_RECIPIENT text
* <--P_LS_SENDER text
* <--P_CF_RETCODE text
FORM set_print_param USING is_addr_key LIKE addr_key
* lc_va_tknum
lc_va_lfnr TYPE nrlevel
CHANGING cs_control_param TYPE ssfctrlop
cs_composer_param TYPE ssfcompop
cs_recipient TYPE swotobjid
cs_sender TYPE swotobjid
cf_retcode TYPE sy-subrc.
DATA: ls_itcpo TYPE itcpo.
DATA: lf_repid TYPE sy-repid.
DATA: lf_device TYPE tddevice.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: lc_va_suffix TYPE rspo2name.
lf_repid = sy-repid.
CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
EXPORTING
pi_nast = nast
pi_addr_key = is_addr_key
pi_repid = lf_repid
IMPORTING
pe_returncode = cf_retcode
pe_itcpo = ls_itcpo
pe_device = lf_device
pe_recipient = cs_recipient
pe_sender = cs_sender.
SHIFT lc_va_lfnr LEFT DELETING LEADING '0'.
CONCATENATE 'PV' lc_va_lfnr INTO lc_va_suffix.
IF cf_retcode = 0.
MOVE-CORRESPONDING ls_itcpo TO cs_composer_param.
cs_composer_param-tdsuffix2 = lc_va_suffix.
cs_control_param-device = lf_device.
cs_control_param-no_dialog = 'X'.
cs_control_param-preview = screen.
cs_control_param-getotf = ls_itcpo-tdgetotf.
cs_control_param-langu = nast-spras.
ENDIF.
ENDFORM. " set_print_param
FORM protocol_nast_update.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = '/Z2a/PVSCHEIN'
msg_nr = '001'
msg_ty = 'E'
* MSG_V2 = SYST-MSGV2
* MSG_V3 = SYST-MSGV3
* MSG_V4 = SYST-MSGV4
* MSG_V1 = SYST-MSGV1
EXCEPTIONS
OTHERS = 1.
ENDFORM.Hello!
I have to customize the enclosed source code so it does the following:
print out for each shipment (see FuBa:RV_SHIPMENT_PRINT_VIEW
parameter slp) really seperated by for every shipment item LIKP-VBELN
and not for the whole VTTP-TKNUM.
The parameter "slp" must be stripted so by leaving
of the routine "get_data_pv" has only the datas of the current
LIKP-VBELN, and in the next step taking the next LIKP-VBELN
and so on. Right now it performs only one time for one VTTP-TKNUM.
If you don't understand VTTP-TKNUM and LIKP-VBELN please refer
to Transaction SE11.
Reagrds
Ilhan -
Print out as well as Sending mail of invoice
Hi
I have a requirement in invoice like, i need print out as well as I need to send mail to the user.
In T-code VF03 , My user will be giving only one transaction medium as External send.
But he needs the print out of the invoice also. how can we arrive at the solution for this..
Kindly send me reply .
Regards
UmaHello Uma,
Yes, it is possible.
As you are aware, the medium will be selected as per the input:
1 Print output
2 Fax
4 Telex
5 External send
6 EDI
7 Simple Mail
8 Special function
9 Events (SAP Business Workflow)
A Distribution (ALE)
If the user is selecting the Print output and he wants the same to be mailed, then add the logic to send the mail in the Z program.
You can get the value for medium in the program with the NAST-NACHA structure.
Please let me know if any more details are required.
Regards,
Selva K -
How do I actually print out the background fill in a table's rows?
Hi guys and gals,
I have been trying to figure out this one for a while now and need some help in diagnosing it. I have a table with alternating colour fill on so that the first row is shaded grey, the next not, the next grey ad infinitum. Now if I print the document to Preview as a PDF then the alternating colours appear. If I then print that PDF document to paper the rows print with the correct alternating fill. If however I try printing the Pages '09 document straight to paper the rows all print out with no fill colour
I cannot seem to find an option anywhere to say "display but don't print the fill in this cell / row". Is there a setting in Pages? I have been through the Inspector thing with a fine-toothed comb but I'm obviously going blind. Or is this a quirk of my printer? If I print an image then it prints the colours ok with no scrimping to save ink. Again I cannot find a setting on the printer to disable the cell / row fill when actually committing a document to paper
So in summary:
Alternating fill produces stripey table on the screen
Printing to PDF shows a stripey table and can be printed to paper with stripes
Printing from Pages '09 to paper removes the stripes
I'm on the very latest version of Lion and Pages '09. My printer is an HP PSC 2179 with up to date drivers etc
Would love some help on this one and a virtual jeroboam of vodka to anyone who can resolve the issue
Cheers,
AndyHi Andreas,
I think you have nothing into SAP to find the structure of a cluster table.
The way I use, is to find a standard program that use this cluster, and I look in the ABAP code the structure used by SAP.
You just have to use the ST05, and use the option to see the code where the cluster has been readed.
Rgd
Frédéric -
Printing out results in case of object-relational table (Oracle)
I have made a table with this structure:
CREATE OR REPLACE TYPE Boat AS OBJECT(
Name varchar2(30),
Ident number,
CREATE OR REPLACE TYPE Type_boats AS TABLE OF Boat;
CREATE TABLE HOUSE(
Name varchar2(40),
MB Type_boats)
NESTED TABLE MB store as P_Boat;
INSERT INTO House VALUES ('Name',Type_boats(Boat('Boat1', 1)));
I am using java to print out all the results by calling a procedure.
CREATE OR REPLACE package House_boats
PROCEDURE add(everything works here)
PROCEDURE results_view;
END House_boats;
CREATE OR REPLACE Package.body House_boats AS
PROCEDURE add(everything works here) AS LANGUAGE JAVA
Name House_boats.add(...)
PROCEDURE results_view AS LANGUAGE JAVA
Name House_boats.resuts_view();
END House_boats;
However, I am not able to get Results.view working in case of object-relation table. This is how I do it in the situation of relational table.
CALL House_boats.results_view();
House_boats.java file which is loaded using LOADJAVA:
import java.sql.*;
import java io.*;
public class House_boats {
public static void results_view ()
throws SQLException
{ String sql =
"SELECT * from House";
try { Connection conn = DriverManager.getConnection
("jdbc:default:connection:");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rset = pstmt.executeQuery();
printResults(rset);
rset.close();
pstmt.close();
catch (SQLException e) {System.err.println(e.getMessage());
static void printResults (ResultSet rset)
throws SQLException { String buffer = "";
try { ResultSetMetaData meta = rset.getMetaData();
int cols = meta.getColumnCount(), rows = 0;
for (int i = 1; i <= cols; i++)
int size = meta.getPrecision(i);
String label = meta.getColumnLabel(i);
if (label.length() > size) size = label.length();
while (label.length() < size) label += " ";
buffer = buffer + label + " "; }
buffer = buffer + "\n";
while (rset.next()) {
rows++;
for (int i = 1; i <= cols; i++) {
int size = meta.getPrecision(i);
String label = meta.getColumnLabel(i);
String value = rset.getString(i);
if (label.length() > size) size = label.length();
while (value.length() < size) value += " ";
buffer = buffer + value + " "; }
buffer = buffer + "\n"; }
if (rows == 0) buffer = "No data found!\n";
System.out.println(buffer); }
catch (SQLException e) {System.err.println(e.getMessage());} }
How do I print out the results correctly in my case of situation?
Thank you in advanceI have made a table with this structure:
I am using java to print out all the results by calling a procedure.
However, I am not able to get Results.view working in case of object-relation table. This is how I do it in the situation of relational table.
How do I print out the results correctly in my case of situation?
There are several things wrong with your code and methodology
1. The code you posted won't even compile because there are several syntax issues.
2. You are trying to use/test Java in the database BEFORE you get the code working outside the DB
3. Your code is not using collections in JDBC properly
I suggest that you use a different, proven approach to developing Java code for use in the DB
1. Use SIMPLE examples and then build on them. In this case that means don't add collections to the example until ALL other aspects of the app work properly.
2. Create and test the Java code OUTSIDE of the database. It is MUCH easier to work outside the database and there are many more tools to help you (e.g. NetBeans, debuggers, DBMS_OUTPUT windows, etc). Trying to debug Java code after you have already loaded it into the DB is too difficult. I'm not aware of anyone, even at the expert level, that develops that way.
3. When using complex functionality like collections first read the Oracle documentation (JDBC Developer Guide and Java Developer's Guide). Those docs have examples that are known to work.
http://docs.oracle.com/cd/B28359_01/java.111/b31225/chfive.htm
http://docs.oracle.com/cd/E11882_01/java.112/e16548/oraarr.htm#sthref583
The main issue with your example is #3 above; you are not using collections properly:
String value = rset.getString(i);
A collection is NOT a string so why would you expect that to work for a nested table?
A collection needs to be treated like a collection. You can even treat the collection as a separate result set. Create your code outside the database and use the debugger in NetBeans (or other) on this replacement code for your 'printResults' method:
static void printResults (ResultSet rset) throws SQLException {
try {
ResultSetMetaData meta = rset.getMetaData();
while (rset.next()) {
ResultSet rs = rset.getArray(2).getResultSet();
rs.next();
String ndx = rs.getString(1);
Struct struct = (Struct) rs.getObject(2);
System.out.println(struct.getSQLTypeName());
Object [] oa = struct.getAttributes();
for (int j = 0; j < oa.length; j++) {
System.out.println(oa[j]);
} catch (SQLException e) {
System.err.println(e.getMessage());
That code ONLY deals with column 2 which is the nested table. It gets that collection as a new resultset ('rs'). Then it gets the contents of that nested table as an array of objects and prints out the attributes of those objects so you can see them.
Step through the above code in a debugger so you can SEE what is happening. NetBeans also lets you enter expressions such as 'rs' in an evaluation window so you can dynamically try the different methods to see what they do for you.
Until you get you code working outside the database don't even bother trying to load it into the DB and create a Java stored procedure.
Since your current issue has nothing to do with this forum I suggest that you mark this thread ANSWERED and repost it in the JDBC forum if you need further help with this issue.
https://forums.oracle.com/community/developer/english/java/database_connectivity
When you repost you can include a link to this current thread if you want. Once your Java code is actually working then try the Java Stored procedure examples in the Java Developer's Guide doc linked above.
At the point you have any issues that relate to Java stored procedures then you should post them in the SQL and PL/SQL forum
https://forums.oracle.com/community/developer/english/oracle_database/sql_and_pl_sql -
Staffing status within organisational structure - adding options (fields)
Hello
within the organisational structure (PPOME) on a position, on the basic data tab there is a drop down table marked STAFFING STATUS. Could you please tell me if there is a way to add to this list to seperate the position into various assignments and statuses.
thank you
EmmaHi Emma,
These staffing status values of positions reside in the "value range" part of domain "HRPOSSTAT".
In order to add new values, you need an access key to repair this object.
Repair activities are not advised so please think twice before carrying out the activity.
P.S. To check Domain value range, go to SE11, select "Domain", write HRPOSSTAT, change -You'll need the access key right at this point-, Value range tab, add new values .
Regards,
Dilek -
Hi . in transaction PPOMA_BBP when i go to system -> List -> Save -> Reporting Tree , the reporting tree is greyed out.
1) Is there another way to extract the organisational structure? I need to save the hierarchy + attributes .
2) If possible, can we use the extract to maintain/ create an organisational structure ?
thxHello,
We got a requirement like.... Suppose X company is having 5 consultants including proj mngr and is doing projects for Y and Z. In Y project 3consultants r involved, n in Z also 3consultants r involved. Proj mngr is common 2 both. We configured reporting structure evrything. But it will display only when we click on the position. The client is asking that... after giving org unit numb in ppom_old, the whole structure has 2 display....ie., who involved in the projects, who is reporting to whom, blablabla.....even in graphical struc also it is not showing...can anybody guide me, whether there is such option in sap.
Thanks -
Organisational structure --- Mapping
Hello dear Experts ...... This is venkat charan a new commer to SAP SD .
My question is..... how to MAP organisation structure in REAL TIME? What r the steps involved in this ? please help me ?Hi Venkat Chanran,
Please find the details below.
Client:
Client is an environment where we are working. A client is an organisation term it is an independent unit in the system, each unit consist of own environment and there fore its has own master data or transaction data assigned ,user master records and chart of accounts.
Master data:
The data, which is the basis for all the SD processing.
Type of Master Data:
1.Organizational data: this is the structure of the company where by each business is represented by a hierarchical element.
2. Customer master data: the data where all data regarding customer and material are stored.
3. Documents: the business transaction is stored in the documents.
4. Global Settings: it is one in which we define country keys and currencies.
Company code:
Legal entity and an independent accounting unit at company code level, where we create balance sheet and profit and loss accounts.
Sales organization:
An organizational unit that sells and distributes products, negotiates terms of sale, and is responsible for these transactions.
Distribution channel:
Channel through which materials or services reach customers. Typical distribution channels include wholesale, retail and direct sales. You can assign a distribution channel to one or more sales organizations.
Division:
Product groups can be defined for a wide-ranging spectrum of products. For every division you can make customer-specific agreements on, for example, partial deliveries, pricing and terms of payment. Within a division you can carry out statistical analyses or set up separate marketing.
Sales area:
Combination of Sales organisation, Distribution Channel, and division.
Sales Office.
Geographical aspects of the organization in business development and sales are defined using the term sales office. A sales office can be considered as a subsidiary.
Sales offices are assigned to sales areas. If you enter a sales order for a sales office within a certain sales area, the sales office must be assigned to that area.
Sales Group.
The staff of a sales office may be subdivided into sales groups. For example, sales groups can be defined for individual divisions.
Salespersons.
Individual personnel master records are used to manage data about salespersons. You can assign a sales person to a sales group in the personnel master record.
Plant:
A plant is a place where either material are produced or goods and services provided.
Storage location:
Where we store the material.
Shipping point:
It is a physical location where we load the goods in order to deliver.
Loading point:
It is a point where we load and unload the material by means of equipments.
Business Area.
A unit in an enterprise, grouping product and market combinations as homogeneously as possible for the purpose of developing unified business policy.
Financial Accounting (FI).
A business area is an organizational unit within financial accounting which represents a separate area of operations or responsibilities within an organization.
The system posts costs and revenue according to the business area.
The business area can be Assigned to the:
sales area (if the accounts are to be posted according to sales)
plant/division (if the accounts are to be posted according to products)
Financial accounting transactions can be allocated to a specific business area.
Credit control area.
Organizational unit in an organization that specifies and checks credit limits for customers. A credit control area can include one or more company codes. It is not possible to assign a company code to more than one credit control areas.
ENTERPRISE STRUCTURE
STEP 1: DEFINE COMPANY
MENU PATH: IMG u2013 ENTERPRICE STRUCTURE
FINANCIAL ACCOUNTING u2013 DEFINATION u2013 DEFINE COMPANY T.C: SPRO
Select the line 1000 and go for details and then click copy, enter the company details and save it. (ctrl s)
step 2: edit copy check delete company code
select the line 1000 go for details and then say copy , fill the details of company code. Then a address screen appears and fill the details .
then save it.
Now go for the next option
We will fine the below screen and click copy button
Press enter
Say yes
Say yes
for the remaining screen say yes to all , now the system will copy the table to your company code.
After copying below screen u will see and the say transport
In below screen u enter u r company code.
the above screen u will see is the transport request screen
Step 2: logistic general
We will get the below screen enter the details of the plant and also fill the address details of the plants and save it
then save it
DEFINE DIVISION:
HERE GO FOR NEW ENTRIES DIRECTLY BECAUSE NO DETAILS ICON IS THEIR.
SALES AND DISTRIBUTION
ENTER ALL THE DETAILS AND SAVE
2. DISTRIBUTION CHANNEL
GO FOR MENU PATH . DEFINE DISTRIBUTION CHANNEL
THEN SAVE IT
DEFINE SALES OFFICE:
MATERIAL MANAGEMENT
THIS IS NOT OUR CONFIGURATION; THIS IS THE PART OF MM CONSULTANT.
DEFINE STORAGE LOCATION
LOGISTIC EXECUTION:
DEFINE SHIPPING POINT
HERE ALSO THE SAME PROCEDURE ,
Select the line 1000 go for details and say copy. Enter the details of shipping point and save it.
The above are the definition part, now we have to link the organizational elements. The linking can be configured with the help of menu path: Img - enterprise structure - assignment
Note: what we have defined in respective module, the same we have to assign with respect to the module.
ASSIGNMENTS:
1. FINANICIAL ACCOUNTING:
ASSIGN COMPANY CODE TO COMPANY:
THEN SAVE IT.
LOGISTIC GENERAL
1. ASSIGN PLANT TO COMPANY CODE:
GO FOR THE COMPANY CODE AND HIGHLIGHT IT, NOW CLICK ASSIGN THEN SELECT THE PLANT IN THE POP UP SCEEN AND PRESS OK, WE HAVE TO GET THE BELOW SCREEN
NOTE : BUSINESS AREA CONCEPT IS VERY IMPORTANT.
SALES AND DISTRIBUTION ASSIGNMENTS
1. ASSIGN SALES ORGANISATION TO COMPANY CODE T.Code : OVX2
2. ASSIGN DISTRIBUTION CHANNEL TO SALES ORGANISATION
T.CODE: OVXK
3. ASSIGN DIVISION TO SALES ORGANISATION
T.CODE: OVXA
4. SET UP SALES AREA:
T.CODE : OVXG
5. ASSIGN SALES OFFICE TO SALES AREA
6.ASSIGN SALES ORGANISATION u2013 DISTRIBUTION CHANNEL u2013 PLANT
T.CODE : OVX6
NO MATERIAL MANAGEMENT ASSIGNMENT OF STORAGE LOCATION
WHY BECAUSE WE HAVE ALREADY MAINTAINED IN THE PLANT, SO IT IS AN ASSIGNMENT.
LOGISTIC EXECUTION
ASSIGN SHIPPING POINT TO PLANT:
NOW OUR ENTERPRISE STRUCTURE IS READY
Result :
Go for Img u2013 enterprise structure u2013 definition u2013 define company u2013 edit copy check delete company code u2013 structure u2013 navigation u2013 double click your created company code. T. code: EC01
Please Reward If Really Helpful,
Thanks and Regards,
Sateesh.Kandula -
How to print out the data from the file ?
hi all,
i have upload my file to here :
[http://www.freefilehosting.net/ft-v052010-05-09 ]
anyone can help me to print out the data from the file ?
the content of the file should be like this :
185.56.83.89 156.110.16.1 17 53037 53 72 1
and for the seven column is
srcIP dstIP prot srcPort dstPort octets packetshi all,
i have try to do this
public static void Readbinary() throws Exception
String file = "D:\\05-09.190501+0800";
DataInputStream dis = new DataInputStream(new FileInputStream(file));
//but then how to read the content ??????can you give me more hint ?????
i have find the netflow v5 structure by C
struct NFHeaderV5{
uint16_t version; // flow-export version number
uint16_t count; // number of flow entries
uint32_t sysUptime;
uint32_t unix_secs;
uint32_t unix_nsecs;
uint32_t flow_sequence; // sequence number
uint8_t engine_type; // no VIP = 0, VIP2 = 1
uint8_t engine_id; // VIP2 slot number
uint16_t reserved; // reserved1,2
struct NFV5{
ipv4addr_t srcaddr; // source IP address
ipv4addr_t dstaddr; // destination IP address
ipv4addr_t nexthop; // next hop router's IP address
uint16_t input; // input interface index
uint16_t output; // output interface index
uint32_t pkts; // packets sent in duration
uint32_t bytes; // octets sent in duration
uint32_t first; // SysUptime at start of flow
uint32_t last; // and of last packet of flow
uint16_t srcport; // TCP/UDP source port number or equivalent
uint16_t dstport; // TCP/UDP destination port number or equivalent
uint8_t pad;
uint8_t tcp_flags; // bitwise OR of all TCP flags in flow; 0x10
// for non-TCP flows
uint8_t prot; // IP protocol, e.g., 6=TCP, 17=UDP, ...
uint8_t tos; // IP Type-of-Service
uint16_t src_as; // originating AS of source address
uint16_t dst_as; // originating AS of destination address
uint8_t src_mask; // source address prefix mask bits
uint8_t dst_mask; // destination address prefix mask bits
uint16_t reserved;
but how to translate the structure to java,then get the data from the file ?
Edited by: 903893 on Dec 21, 2011 10:52 PM -
Creating organisation structure (SPRO) for an integrated steel plant
HI,
For an integrated steel plant of 2.2 mt capacity (green field) need organisation structure to define. It would be a single legal entity under which the plant would produce wire rods, reinforement bar, billets, coke, sinter, ductile iron pipe, power, pig iron. The ISP will have Blast furnacec, SMS, rolling mill, coke oven, sinter plant, pallete plant, oxygen plant, lime plant, dolo plant, raw materila handling plant, power plant.
Can any body guide to decide the suitable org structure for such spread of manufacturing facilities. We need to identify the hirarchical structure w.r.t Company, Company code, Controlling area, business area, functional area, plant, profit center, cost center with a visioning that in future, the company would come up with other units also of similary capacity.
The plant is at green field stage coming up absolutely from scratch. New set of people has formed the work force top to botton.Desigred reporting (MIS) structure not yet crystalised. Have bent of mind to accept best practice. The plant is in Indian environment.
Request an early reponse please.
Thanks
Saradindu PaulHello All,
CAn some body please help, As Project manager for SAP role out I am facing same dillema regarding the org structuring in SAP ECC6.0 -
Organisation Structure is not replicating completely from R/3 to CRM
Hi SAP Gurus,
Plaese help me out in this issue.
We are replicating organisation structure from R/3 to CRM. There is Org Structure in which there are some sub org units say 6, under main org unit with positions and jobs. When try to replicating by tcode PFAL with evaluation path OS-CP, it geneartes IDOC in R/3, all are succesfully processed and Green. IN CRM, these Idocs are red and yellow with staus 51 and 52. As a result of this partial, org structure is replicated to CRM. In CRM, the Idoc is failed and It shows following errors:-->
1. Resource key 4AFBD7B949F406E9E10000000B7404B7 is not known (Status 51)
2. HR: ALE inbound processing for HR master data (Status 52)
3. No Filter, No Conversion, No Field converted.
Plaese advice to resolve this issue.
Thanks a lot,
Kind Regards
Ash
Edited by: Raman Khatri on Nov 23, 2009 2:43 PM
Edited by: Raman Khatri on Nov 23, 2009 2:47 PMYou can copy exactly error ??..
For replication you need use tx PIDE in R3.
In folder CRM>R3 you assign "BP Classification: Consumer, Customer, Sales prospect, competitor" to account group in R3. The BP Classification is hard code in CRM and only are available 5 types of classification.
In folder R3> CRM you assing Account group R3 to CRM Classifcation and grouping. Grouping CRM is done in SPRO > Cross-Application Components >SAP Business Partner > Basic Settings > Number Ranges and Groupings > Define Groupings and Assign Number Ranges.
Then, you define filter for replication in tx R3AC1 and replicate with tx R3AS -
Narrative reports not showing beyond first page if printed out
I'm trying to print out a CO1/CO2 record using the 'printer friendly' function.
Although everything appears fine on screen, all narrative reports in the related information sections do not appear in the printout if it extends to more than 1 page. This only occurs for IE6 which is our company default browser. We will be upgrading to IE7 but that will be only some time next year and till then, the users need to print out these reports. I've also tested and it doesn't happen for firefox as well.
I'm out of workarounds/ideas so if anyone has any, it's greatly appreciated.Hi,
I did not understand the requirement completely but would suggest you to use STARTPAGE field of the CONTROL_PARAMETERS structure.
We use CONTROL_PARAMETERS while calling the SMART Form from Application program as an import parameter. By default SmartForms is printed from First page. If you want it to start printing from some other page set the field 'CONTROL_PARAMETERS-STARTPAGE'.
Hope it helps. -
Modification date should come on PO Print out
Hi,
I want to show the Modification Dates on PO Print out.. means whenever we change in the PO, that modification date should show in the PO Printout. Is there any idea for do it...
NOTE: - Please note that I m using the copy of Standard Script MEDRUCK.
Regards,Hi,
Now in my PO printout, last date of changed PO is coming... i write a PERFORM in script with subroutine.
But i want all the modified dated...means whenever the PO has been changed, all dates should come on printout.
Please help me...My code is:----
FORM f_convert_changed TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
READ TABLE in_par WITH KEY c_ebeln_ekpo.
CHECK sy-subrc = 0.
l_ebeln = in_par-value.
SELECT udate
INTO date_c
FROM cdhdr
WHERE objectclas = 'EINKBELEG'
AND objectid = l_ebeln
AND tcode NOT LIKE 'ME21%'.
a = date_c+0(4).
b = date_c+4(2).
f = date_c+6(2).
CONCATENATE f b a INTO date_ch SEPARATED BY '.'.
READ TABLE out_par WITH KEY 'DATE_CH'.
CHECK sy-subrc = 0.
out_par-value = date_ch.
MODIFY out_par INDEX sy-tabix.
ENDSELECT.
ENDFORM. "f_convert_DATE
and PERFORM in Script is:----
/:DEFINE &DATE_CH&
/:PERFORM F_CONVERT_CHANGED IN PROGRAM ZPO_MEDRUCK1
/:USING &CDHDR-OBJECTCLAS&
/:USING &EKPO-EBELN&
/:CHANGING &DATE_CH&
/:ENDPERFORM
I1Changed Date : &DATE_CH&
Thanks... -
Need help printing out a BinarySearchTree
I am trying to write a method to print out a BinarySearchTree, so I can better debug my code. For instance, if the binarysearchtree is in this form:
6
3 9
2 4 12 8
Then I want to print out this exact form using System.out.println. The recursive traversal techniques (inorder, postorder, preorder) do not accomplish this. When I tried to use one of the technique, I got a weird looking tree that either rotate 90 degree or upside down. Any ideas? ThanksI agree, but I would like to take this opportunity to
learn some new trick too.There isn't any trick. There's just a lot of grungy programming. You have to keep track of how many nodes you're going to display on line 1, line 2, line 3, and so on. And how wide those nodes are. (And "how wide a node is" depends on how wide its children are and whether its neighbours have children or not.) You can't display line 1 until you have laid out the entire tree conceptually, because you don't know how much space to leave to its left so that it is centred above its children.
Now if you've got a complete binary tree (as uj suggested earlier) then this is simple. But if you don't, then it isn't simple at all. Unless, of course, you want to pretend that you do, and just leave space where the missing nodes are. That would be pretty simple. Find the maximum depth of your tree, call that D, and find the maximum width of a node, call that N. Then the bottom level of your tree would be N * 2^D wide (I probably have an off-by-one error in D there so fix that if necessary).
So line 1 has one node, which automatically goes in the middle. If line 2 is the last line then its two nodes go at the right and left ends. If it isn't, but line 3 is going to be the last line, then line 2's nodes go 1/6 and 5/6 of the way across. If there's going to be four lines the line 2's nodes go 3/14 and 11/14 of the way across. (I figured those out by drawing pictures like the examples you posted.) Find the general formula that yields these numbers. Then do the same for line 3 and line N.
(If you want to draw the tree upside-down, it's quite a bit easier. Draw the last line, keeping track of where you draw each node. Then when you draw the next line, each node gets drawn between where you drew its children, recursively.)
This is the simple version we are doing here, remember. You will probably learn a lot by finishing it off, but not a lot about tree structures. The general version is not a generalization of this algorithm, but a completely different algorithm.
Maybe you are looking for
-
IWeb Hangs at launch in Mountain Lion
Since upgrading to Mountain Lion ... when I launch iWeb ... it just hangs .... I can't open my domain ... help!
-
Using function equivalent to sscanf in JAVA
Hello, All I want to do in java is to read the data saved in a buffer( a lot of numbers and characters seperated by semicolons) and organize it into columns of data saved in an outfile!!!! To this end each number or character seperated by a " ; " fro
-
Best practice for dependencies that require manual download?
Hi, what is the right thing to do when creating a package, that requires the user to manually download something? Specifically, I am creating a package, that installs the LeapMotion software (a .deb file). As it requires a developer account to downlo
-
Acrobat msvcr80.dll error
I did a search of the forums and only came across one reference to acrobat.exe and msvcr80.dll. Running Acrobat 8.0 - I'm running into the following error on one of my user's computers when opening certain PDFs. An example is attached.: Faulting app
-
Swap space - upgrading to solaris 8
Hi I have Solaris 2.6, 3Gb RAM and # swap -l swapfile dev swaplo blocks free /dev/dsk/c0t0d0s4 32,4 16 527024 378752. # vmstat procs memory page disk faults cpu r b w swap free re mf pi po fr de sr f0 m1 m1 m1 in sy cs us sy id 0 0 0 22392 13240 10 3